aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/MenuItem.cc
diff options
context:
space:
mode:
authorMark Tiefenbruck <mark@fluxbox.org>2007-12-25 05:58:50 (GMT)
committerMark Tiefenbruck <mark@fluxbox.org>2007-12-25 05:58:50 (GMT)
commit9daf464b2812027c4a5a074f23896457471109f1 (patch)
treec3f0b0a856a45a0b02e55244098fa6cbc21425e0 /src/FbTk/MenuItem.cc
parenteaabe0321d66d348405f32eacda2be6acb018eca (diff)
downloadfluxbox-9daf464b2812027c4a5a074f23896457471109f1.zip
fluxbox-9daf464b2812027c4a5a074f23896457471109f1.tar.bz2
fix showing program icons with depth=1 in menus
Diffstat (limited to 'src/FbTk/MenuItem.cc')
-rw-r--r--src/FbTk/MenuItem.cc28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/FbTk/MenuItem.cc b/src/FbTk/MenuItem.cc
index 0e99192..7bfb8ef 100644
--- a/src/FbTk/MenuItem.cc
+++ b/src/FbTk/MenuItem.cc
@@ -114,14 +114,30 @@ void MenuItem::draw(FbDrawable &draw,
114 int icon_x = x + theme.bevelWidth(); 114 int icon_x = x + theme.bevelWidth();
115 int icon_y = y + theme.bevelWidth(); 115 int icon_y = y + theme.bevelWidth();
116 // enable clip mask 116 // enable clip mask
117 XSetClipMask(disp, gc, None); //tmp_mask.drawable()); 117 XSetClipMask(disp, gc, tmp_mask.drawable());
118 XSetClipOrigin(disp, gc, icon_x, icon_y); 118 XSetClipOrigin(disp, gc, icon_x, icon_y);
119 119
120 draw.copyArea(tmp_pixmap.drawable(), 120 if (draw.depth() == tmp_pixmap.depth()) {
121 gc, 121 draw.copyArea(tmp_pixmap.drawable(),
122 0, 0, 122 gc,
123 icon_x, icon_y, 123 0, 0,
124 tmp_pixmap.width(), tmp_pixmap.height()); 124 icon_x, icon_y,
125 tmp_pixmap.width(), tmp_pixmap.height());
126 } else { // TODO: wrong in soon-to-be-common circumstances
127 XGCValues backup;
128 XGetGCValues(draw.display(), gc, GCForeground|GCBackground,
129 &backup);
130 XSetForeground(draw.display(), gc,
131 Color("black", theme.screenNum()).pixel());
132 XSetBackground(draw.display(), gc,
133 Color("white", theme.screenNum()).pixel());
134 XCopyPlane(draw.display(), tmp_pixmap.drawable(),
135 draw.drawable(), gc,
136 0, 0, tmp_pixmap.width(), tmp_pixmap.height(),
137 icon_x, icon_y, 1);
138 XSetForeground(draw.display(), gc, backup.foreground);
139 XSetBackground(draw.display(), gc, backup.background);
140 }
125 141
126 // restore clip mask 142 // restore clip mask
127 XSetClipMask(disp, gc, None); 143 XSetClipMask(disp, gc, None);