diff options
author | Mathias Gumz <akira at fluxbox dot org> | 2011-02-22 21:07:39 (GMT) |
---|---|---|
committer | Mathias Gumz <akira at fluxbox dot org> | 2011-02-22 21:07:39 (GMT) |
commit | d11aa42ace928efc3dd1eebc8988b6bbbc005b2b (patch) | |
tree | 0574ed4eaa5092386d3cf5440c636ea586baaebe /src/FbTk/Transparent.cc | |
parent | b7e84104a695bb3628e482c4be93f6f516e46e7d (diff) | |
download | fluxbox-d11aa42ace928efc3dd1eebc8988b6bbbc005b2b.zip fluxbox-d11aa42ace928efc3dd1eebc8988b6bbbc005b2b.tar.bz2 |
bugfix: consistent use of 'int' for alpha values (#3187373)
WindowMenuAccessor returned strange alpha values if compiled
with 'g++ -Os'; unholy black magic happens if template<int> faces
functions returning only 'usigned char'.
Diffstat (limited to 'src/FbTk/Transparent.cc')
-rw-r--r-- | src/FbTk/Transparent.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/FbTk/Transparent.cc b/src/FbTk/Transparent.cc index bf8a110..04fee67 100644 --- a/src/FbTk/Transparent.cc +++ b/src/FbTk/Transparent.cc | |||
@@ -43,7 +43,7 @@ using std::endl; | |||
43 | 43 | ||
44 | namespace { | 44 | namespace { |
45 | #ifdef HAVE_XRENDER | 45 | #ifdef HAVE_XRENDER |
46 | Picture createAlphaPic(Window drawable, unsigned char alpha) { | 46 | Picture createAlphaPic(Window drawable, int alpha) { |
47 | Display *disp = FbTk::App::instance()->display(); | 47 | Display *disp = FbTk::App::instance()->display(); |
48 | _FB_USES_NLS; | 48 | _FB_USES_NLS; |
49 | 49 | ||
@@ -149,7 +149,7 @@ bool Transparent::haveComposite(bool for_real) { | |||
149 | return s_use_composite; | 149 | return s_use_composite; |
150 | } | 150 | } |
151 | 151 | ||
152 | Transparent::Transparent(Drawable src, Drawable dest, unsigned char alpha, int screen_num): | 152 | Transparent::Transparent(Drawable src, Drawable dest, int alpha, int screen_num): |
153 | m_alpha_pic(0), m_src_pic(0), m_dest_pic(0), | 153 | m_alpha_pic(0), m_src_pic(0), m_dest_pic(0), |
154 | m_source(src), m_dest(dest), m_alpha(alpha) { | 154 | m_source(src), m_dest(dest), m_alpha(alpha) { |
155 | 155 | ||
@@ -196,7 +196,7 @@ Transparent::~Transparent() { | |||
196 | #endif // HAVE_XRENDER | 196 | #endif // HAVE_XRENDER |
197 | } | 197 | } |
198 | 198 | ||
199 | void Transparent::setAlpha(unsigned char alpha) { | 199 | void Transparent::setAlpha(int alpha) { |
200 | if (m_source == 0 || !s_render) | 200 | if (m_source == 0 || !s_render) |
201 | return; | 201 | return; |
202 | 202 | ||
@@ -254,7 +254,7 @@ void Transparent::setSource(Drawable source, int screen_num) { | |||
254 | return; | 254 | return; |
255 | // save old alpha value so we can recreate new later | 255 | // save old alpha value so we can recreate new later |
256 | // with the same value | 256 | // with the same value |
257 | unsigned char old_alpha = m_alpha; | 257 | int old_alpha = m_alpha; |
258 | if (m_alpha_pic != 0) | 258 | if (m_alpha_pic != 0) |
259 | freeAlpha(); | 259 | freeAlpha(); |
260 | 260 | ||
@@ -314,7 +314,7 @@ void Transparent::render(int src_x, int src_y, | |||
314 | #endif // HAVE_XRENDER | 314 | #endif // HAVE_XRENDER |
315 | } | 315 | } |
316 | 316 | ||
317 | void Transparent::allocAlpha(unsigned char alpha) { | 317 | void Transparent::allocAlpha(int alpha) { |
318 | #ifdef HAVE_XRENDER | 318 | #ifdef HAVE_XRENDER |
319 | if (m_source == 0 || !s_render) | 319 | if (m_source == 0 || !s_render) |
320 | return; | 320 | return; |