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/FbWindow.cc | |
parent | b7e84104a695bb3628e482c4be93f6f516e46e7d (diff) | |
download | fluxbox_pavel-d11aa42ace928efc3dd1eebc8988b6bbbc005b2b.zip fluxbox_pavel-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/FbWindow.cc')
-rw-r--r-- | src/FbTk/FbWindow.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 5b52a03..00dde66 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc | |||
@@ -171,7 +171,7 @@ void FbWindow::invalidateBackground() { | |||
171 | 171 | ||
172 | void FbWindow::updateBackground(bool only_if_alpha) { | 172 | void FbWindow::updateBackground(bool only_if_alpha) { |
173 | Pixmap newbg = m_lastbg_pm; | 173 | Pixmap newbg = m_lastbg_pm; |
174 | unsigned char alpha = 255; | 174 | int alpha = 255; |
175 | bool free_newbg = false; | 175 | bool free_newbg = false; |
176 | 176 | ||
177 | if (m_lastbg_pm == None && !m_lastbg_color_set) | 177 | if (m_lastbg_pm == None && !m_lastbg_color_set) |
@@ -344,7 +344,7 @@ void FbWindow::updateTransparent(int the_x, int the_y, unsigned int the_width, u | |||
344 | #endif // HAVE_XRENDER | 344 | #endif // HAVE_XRENDER |
345 | } | 345 | } |
346 | 346 | ||
347 | void FbWindow::setAlpha(unsigned char alpha) { | 347 | void FbWindow::setAlpha(int alpha) { |
348 | #ifdef HAVE_XRENDER | 348 | #ifdef HAVE_XRENDER |
349 | if (FbTk::Transparent::haveComposite()) { | 349 | if (FbTk::Transparent::haveComposite()) { |
350 | if (m_transparent.get() != 0) { | 350 | if (m_transparent.get() != 0) { |
@@ -371,7 +371,7 @@ void FbWindow::setAlpha(unsigned char alpha) { | |||
371 | #endif // HAVE_XRENDER | 371 | #endif // HAVE_XRENDER |
372 | } | 372 | } |
373 | 373 | ||
374 | unsigned char FbWindow::alpha() const { | 374 | int FbWindow::alpha() const { |
375 | #ifdef HAVE_XRENDER | 375 | #ifdef HAVE_XRENDER |
376 | if (m_transparent.get()) | 376 | if (m_transparent.get()) |
377 | return m_transparent->alpha(); | 377 | return m_transparent->alpha(); |
@@ -588,7 +588,7 @@ long FbWindow::eventMask() const { | |||
588 | 588 | ||
589 | } | 589 | } |
590 | 590 | ||
591 | void FbWindow::setOpaque(unsigned char alpha) { | 591 | void FbWindow::setOpaque(int alpha) { |
592 | #ifdef HAVE_XRENDER | 592 | #ifdef HAVE_XRENDER |
593 | static Atom m_alphaatom = XInternAtom(display(), "_NET_WM_WINDOW_OPACITY", False); | 593 | static Atom m_alphaatom = XInternAtom(display(), "_NET_WM_WINDOW_OPACITY", False); |
594 | unsigned long opacity = alpha * 0x1010101; | 594 | unsigned long opacity = alpha * 0x1010101; |