]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
defualt START_WITH_NEXT to true for desktops too
[chaz/openbox] / src / client.cc
index 618277343cc5e6eaa04a10afe130c316f8e17a00..53a6d768eec94a2eeb2bbd94b0606d8a3a81a73a 100644 (file)
@@ -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)
This page took 0.024066 seconds and 4 git commands to generate.