aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Ewmh.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 52568a1..291c39b 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -198,13 +198,23 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
198 Display* dpy = FbTk::App::instance()->display(); 198 Display* dpy = FbTk::App::instance()->display();
199 int scrn = winclient.screen().screenNumber(); 199 int scrn = winclient.screen().screenNumber();
200 200
201 // the icon will not be used by the client but by
202 // 'menu', 'iconbar', 'titlebar'. all these entities
203 // are created based upon the rootwindow and
204 // the default depth. if we would use winclient.depth()
205 // and winclient.drawable() here we might get into trouble
206 // (xfce4-terminal, skype .. 32bit visuals vs 24bit fluxbox
207 // entities)
208 Drawable parent = winclient.screen().rootWindow().drawable();
209 unsigned int depth = DefaultDepth(dpy, scrn);
210
201 // pick the smallest icon size atm 211 // pick the smallest icon size atm
202 // TODO: find a better criteria 212 // TODO: find a better criteria
203 width = icon_data.begin()->first.first; 213 width = icon_data.begin()->first.first;
204 height = icon_data.begin()->first.second; 214 height = icon_data.begin()->first.second;
205 215
206 // tmp image for the pixmap 216 // tmp image for the pixmap
207 XImage* img_pm = XCreateImage(dpy, DefaultVisual(dpy, scrn), winclient.depth(), 217 XImage* img_pm = XCreateImage(dpy, DefaultVisual(dpy, scrn), depth,
208 ZPixmap, 218 ZPixmap,
209 0, NULL, width, height, 32, 0); 219 0, NULL, width, height, 32, 0);
210 if (!img_pm) { 220 if (!img_pm) {
@@ -280,8 +290,8 @@ void extractNetWmIcon(Atom net_wm_icon, WinClient& winclient) {
280 290
281 // the final icon 291 // the final icon
282 FbTk::PixmapWithMask icon; 292 FbTk::PixmapWithMask icon;
283 icon.pixmap() = FbTk::FbPixmap(winclient.drawable(), width, height, winclient.depth()); 293 icon.pixmap() = FbTk::FbPixmap(parent, width, height, depth);
284 icon.mask() = FbTk::FbPixmap(winclient.drawable(), width, height, 1); 294 icon.mask() = FbTk::FbPixmap(parent, width, height, 1);
285 295
286 FbTk::GContext gc_pm(icon.pixmap()); 296 FbTk::GContext gc_pm(icon.pixmap());
287 FbTk::GContext gc_mask(icon.mask()); 297 FbTk::GContext gc_mask(icon.mask());