all repos — fluxbox @ 1da473bab9fa7b18ae925f8e084465c4c81bc3c9

custom fork of the fluxbox windowmanager

Use _NET_WM_ICON from 32bit apps (xfce4-terminal) correctly

The icons coming from _NET_WM_ICON are argb32. fluxbox uses such icons
in entities such as 'clientmenu', 'iconbar', 'titlebar'. These entities
are not related to the depth of the winclient but to fluxbox's default
depth. Using 'winclient.depth()' is a mistake, since fluxbox is unable
to copy pixmaps from 32bit to 24/16/15bit.

It is not necessary either, because fluxbox should extract the argb32 icon
data directly into the pixmap with the correct depth in the first place.

This fixes (reopened) bug #1852693.

Note: The whole icon code in fluxbox is quite messy, lots of copying and
scaling. It might be simpler and fater to just extract the icon when needed
, in just the size that is needed.
Mathias Gumz akira at fluxbox dot org
commit

1da473bab9fa7b18ae925f8e084465c4c81bc3c9

parent

822c02e96a88a90540fa622afa5ab196b9ba5a7c

1 files changed, 13 insertions(+), 3 deletions(-)

jump to
M src/Ewmh.ccsrc/Ewmh.cc

@@ -198,13 +198,23 @@

Display* dpy = FbTk::App::instance()->display(); int scrn = winclient.screen().screenNumber(); + // the icon will not be used by the client but by + // 'menu', 'iconbar', 'titlebar'. all these entities + // are created based upon the rootwindow and + // the default depth. if we would use winclient.depth() + // and winclient.drawable() here we might get into trouble + // (xfce4-terminal, skype .. 32bit visuals vs 24bit fluxbox + // entities) + Drawable parent = winclient.screen().rootWindow().drawable(); + unsigned int depth = DefaultDepth(dpy, scrn); + // pick the smallest icon size atm // TODO: find a better criteria width = icon_data.begin()->first.first; height = icon_data.begin()->first.second; // tmp image for the pixmap - XImage* img_pm = XCreateImage(dpy, DefaultVisual(dpy, scrn), winclient.depth(), + XImage* img_pm = XCreateImage(dpy, DefaultVisual(dpy, scrn), depth, ZPixmap, 0, NULL, width, height, 32, 0); if (!img_pm) {

@@ -280,8 +290,8 @@ }

// the final icon FbTk::PixmapWithMask icon; - icon.pixmap() = FbTk::FbPixmap(winclient.drawable(), width, height, winclient.depth()); - icon.mask() = FbTk::FbPixmap(winclient.drawable(), width, height, 1); + icon.pixmap() = FbTk::FbPixmap(parent, width, height, depth); + icon.mask() = FbTk::FbPixmap(parent, width, height, 1); FbTk::GContext gc_pm(icon.pixmap()); FbTk::GContext gc_mask(icon.mask());