all repos — fluxbox @ 6df9d6ed54a299c0897cdd2d8aa380dc02b15a41

custom fork of the fluxbox windowmanager

fix drawing foreground when transparency off
simonb simonb
commit

6df9d6ed54a299c0897cdd2d8aa380dc02b15a41

parent

e57a30f664f7fb2660967f40db2c10759c2e9e4f

2 files changed, 27 insertions(+), 14 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.13 +*05/04/27: + * Fix drawing when transparency off (Simon) + FbWindow.cc *05/04/26: * Fix systray icon sizing (send a configurenotify on resize) (Simon) SystemTray.cc WinClient.hh/cc FbTk/FbWindow.hh/cc Window.cc
M src/FbTk/FbWindow.ccsrc/FbTk/FbWindow.cc

@@ -159,11 +159,12 @@

if (only_if_alpha && alpha == 255) return; - - if (alpha != 255 && m_lastbg_pm != ParentRelative) { + // still use bg buffer pixmap if transparent + // cause it does nice caching things + if (m_lastbg_pm != ParentRelative) { // update source and destination if needed Pixmap root = FbPixmap::getRootPixmap(screenNumber()); - if (m_transparent->source() != root) + if (alpha != 255 && m_transparent->source() != root) m_transparent->setSource(root, screenNumber()); FbPixmap newpm = FbPixmap(*this, width(), height(), depth());

@@ -178,7 +179,9 @@ // copy from window if no color and no bg...

newpm.copyArea((m_lastbg_pm == None)?drawable():m_lastbg_pm, gc, 0, 0, 0, 0, width(), height()); } XFreeGC(display(), gc); - m_transparent->setDest(newpm.drawable(), screenNumber()); + + if (alpha != 255) + m_transparent->setDest(newpm.drawable(), screenNumber()); // get root position

@@ -196,15 +199,17 @@ }

} // render background image from root pos to our window - m_transparent->render(root_x, root_y, - 0, 0, - width(), height()); + if (alpha != 255) + m_transparent->render(root_x, root_y, + 0, 0, + width(), height()); // render any foreground items if (m_renderer) m_renderer->renderForeground(*this, newpm); - m_transparent->freeDest(); // it's only temporary, don't leave it hanging around + if (alpha != 255) + m_transparent->freeDest(); // it's only temporary, don't leave it hanging around newbg = newpm.release(); }

@@ -315,12 +320,17 @@ m_transparent.reset(0);

// don't setOpaque, let controlling objects do that // since it's only needed on toplevel windows - } else if (m_transparent.get() == 0 && alpha < 255) { - m_transparent.reset(new Transparent(FbPixmap::getRootPixmap(screenNumber()), window(), alpha, screenNumber())); - } else if (alpha < 255 && alpha != m_transparent->alpha()) - m_transparent->setAlpha(alpha); - else if (alpha == 255) - m_transparent.reset(0); // destroy transparent object + } else { + if (!FbTk::Transparent::haveRender()) + alpha = 255; + + if (m_transparent.get() == 0 && alpha < 255) { + m_transparent.reset(new Transparent(FbPixmap::getRootPixmap(screenNumber()), window(), alpha, screenNumber())); + } else if (alpha < 255 && alpha != m_transparent->alpha()) + m_transparent->setAlpha(alpha); + else if (alpha == 255) + m_transparent.reset(0); // destroy transparent object + } #endif // HAVE_XRENDER }