aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/fbsetroot.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/util/fbsetroot.cc b/util/fbsetroot.cc
index 07f6b68..0859960 100644
--- a/util/fbsetroot.cc
+++ b/util/fbsetroot.cc
@@ -38,11 +38,6 @@ using std::cerr;
38using std::endl; 38using std::endl;
39using std::string; 39using std::string;
40 40
41inline int getRootDepth(const FbTk::FbWindow& w) {
42 return (w.depth() == 32 ? 24 : w.depth());
43}
44
45
46fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name) 41fbsetroot::fbsetroot(int argc, char **argv, char *dpy_name)
47 : FbTk::App(dpy_name), m_app_name(argv[0]) { 42 : FbTk::App(dpy_name), m_app_name(argv[0]) {
48 43
@@ -202,7 +197,7 @@ void fbsetroot::solid() {
202 pixmap = new Pixmap(XCreatePixmap(display(), 197 pixmap = new Pixmap(XCreatePixmap(display(),
203 root.window(), 198 root.window(),
204 root.width(), root.height(), 199 root.width(), root.height(),
205 getRootDepth(root))); 200 root.depth()));
206 201
207 XFillRectangle(display(), *pixmap, gc.gc(), 0, 0, 202 XFillRectangle(display(), *pixmap, gc.gc(), 0, 0,
208 root.width(), root.height()); 203 root.width(), root.height());
@@ -254,7 +249,7 @@ void fbsetroot::modula(int x, int y) {
254 // bitmap used as tile, needs to have the same depth as background pixmap 249 // bitmap used as tile, needs to have the same depth as background pixmap
255 r_bitmap = XCreatePixmap(display(), 250 r_bitmap = XCreatePixmap(display(),
256 root.window(), s, s, 251 root.window(), s, s,
257 (root.depth() == 32 ? 24 : root.depth())); 252 root.depth());
258 253
259 FbTk::Color f(fore, screen), b(back, screen); 254 FbTk::Color f(fore, screen), b(back, screen);
260 255
@@ -278,7 +273,7 @@ void fbsetroot::modula(int x, int y) {
278 pixmap = new Pixmap(XCreatePixmap(display(), 273 pixmap = new Pixmap(XCreatePixmap(display(),
279 root.window(), 274 root.window(),
280 root.width(), root.height(), 275 root.width(), root.height(),
281 getRootDepth(root))); 276 root.depth()));
282 277
283 XFillRectangle(display(), *pixmap, gc.gc(), 0, 0, 278 XFillRectangle(display(), *pixmap, gc.gc(), 0, 0,
284 root.width(), root.height()); 279 root.width(), root.height());
@@ -324,7 +319,7 @@ void fbsetroot::gradient() {
324 pixmap = new Pixmap(XCreatePixmap(display(), 319 pixmap = new Pixmap(XCreatePixmap(display(),
325 root.window(), 320 root.window(),
326 root.width(), root.height(), 321 root.width(), root.height(),
327 getRootDepth(root))); 322 root.depth()));
328 323
329 324
330 XCopyArea(display(), tmp, *pixmap, gc.gc(), 0, 0, 325 XCopyArea(display(), tmp, *pixmap, gc.gc(), 0, 0,