From 4f4d5e25d9a0cf1fc4c0d1a8b7777a560494b7a4 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Fri, 21 Oct 2011 08:34:37 +0200 Subject: bugfix: fbsetroot needs to use 24bit visuals as well 12f44680dfefde602f3387c6d385f4c5e68990e4 introduced ARGB visuals. if fluxbox creates 32bit visuals for the container window or the root window: does not work. --- util/fbsetroot.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/util/fbsetroot.cc b/util/fbsetroot.cc index cb55e16..e18e829 100644 --- a/util/fbsetroot.cc +++ b/util/fbsetroot.cc @@ -54,6 +54,11 @@ using std::cerr; using std::endl; using std::string; +inline int getRootDepth(const FbTk::FbWindow& w) { + return (w.depth() == 32 ? 24 : w.depth()); +} + + fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name) : FbTk::App(dpy_name), m_app_name(argv[0]) { @@ -213,7 +218,7 @@ void fbsetroot::solid() { pixmap = new Pixmap(XCreatePixmap(display(), root.window(), root.width(), root.height(), - root.depth())); + getRootDepth(root))); XFillRectangle(display(), *pixmap, gc.gc(), 0, 0, root.width(), root.height()); @@ -262,7 +267,7 @@ void fbsetroot::modula(int x, int y) { // bitmap used as tile, needs to have the same depth as background pixmap r_bitmap = XCreatePixmap(display(), root.window(), 16, 16, - root.depth()); + (root.depth() == 32 ? 24 : root.depth())); FbTk::Color f(fore, screen), b(back, screen); @@ -286,7 +291,7 @@ void fbsetroot::modula(int x, int y) { pixmap = new Pixmap(XCreatePixmap(display(), root.window(), root.width(), root.height(), - root.depth())); + getRootDepth(root))); XFillRectangle(display(), *pixmap, gc.gc(), 0, 0, root.width(), root.height()); @@ -332,7 +337,7 @@ void fbsetroot::gradient() { pixmap = new Pixmap(XCreatePixmap(display(), root.window(), root.width(), root.height(), - root.depth())); + getRootDepth(root))); XCopyArea(display(), tmp, *pixmap, gc.gc(), 0, 0, -- cgit v0.11.2