X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=53a6d768eec94a2eeb2bbd94b0606d8a3a81a73a;hb=31d41a7aa60b06caea77d2c20af48e5c54eed600;hp=618277343cc5e6eaa04a10afe130c316f8e17a00;hpb=fd7668947091b11c9d9d5775edf5f414e4be6173;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 61827734..53a6d768 100644 --- a/src/client.cc +++ b/src/client.cc @@ -77,6 +77,7 @@ Client::Client(int screen, Window window) updateClass(); updateStrut(); updateIcons(); + updateKwmIcon(); // this makes sure that these windows appear on all desktops if (/*_type == Type_Dock ||*/ _type == Type_Desktop) @@ -575,6 +576,17 @@ void Client::updateWMHints(bool initstate) } else // no group! _group = None; + if (hints->flags & IconPixmapHint) { + updateKwmIcon(); // try get the kwm icon first, this is a fallback only + if (_pixmap_icon == None) { + _pixmap_icon = hints->icon_pixmap; + if (hints->flags & IconMaskHint) + _pixmap_icon_mask = hints->icon_mask; + else + _pixmap_icon_mask = None; + } + } + XFree(hints); } @@ -755,6 +767,22 @@ void Client::updateIcons() if (frame) frame->adjustIcon(); } +void Client::updateKwmIcon() +{ + _pixmap_icon = _pixmap_icon_mask = None; + + unsigned long num = 2; + Pixmap *data; + if (otk::Property::get(_window, otk::Property::atoms.kwm_win_icon, + otk::Property::atoms.kwm_win_icon, &num, &data)) { + if (num >= 2) { + _pixmap_icon = data[0]; + _pixmap_icon_mask = data[1]; + } + delete [] data; + } +} + void Client::propertyHandler(const XPropertyEvent &e) { otk::EventHandler::propertyHandler(e); @@ -800,6 +828,8 @@ void Client::propertyHandler(const XPropertyEvent &e) updateStrut(); else if (e.atom == otk::Property::atoms.net_wm_icon) updateIcons(); + else if (e.atom == otk::Property::atoms.kwm_win_icon) + updateKwmIcon(); } void Client::setWMState(long state)