]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
support net_wm_strut's! nothing to do with them yet however
[chaz/openbox] / src / client.cc
index 95d1509562d114b6a7861d10807a7973ac10e31c..a2106d867749f901fa0d78d85b3cea03af65b64c 100644 (file)
@@ -48,13 +48,13 @@ OBClient::OBClient(int screen, Window window)
   getType();
 
   // set the decorations and functions
+  _decorations = Decor_Titlebar | Decor_Handle | Decor_Border |
+    Decor_Iconify | Decor_Maximize;
+  _functions = Func_Resize | Func_Move | Func_Iconify | Func_Maximize;
   switch (_type) {
   case Type_Normal:
     // normal windows retain all of the possible decorations and
     // functionality
-    _decorations = Decor_Titlebar | Decor_Handle | Decor_Border |
-                   Decor_Iconify | Decor_Maximize;
-    _functions = Func_Resize | Func_Move | Func_Iconify | Func_Maximize;
 
   case Type_Dialog:
     // dialogs cannot be maximized
@@ -89,6 +89,7 @@ OBClient::OBClient(int screen, Window window)
   updateTitle();
   updateIconTitle();
   updateClass();
+  updateStrut();
 
   calcLayer();
   changeState();
@@ -487,6 +488,29 @@ void OBClient::updateClass()
 }
 
 
+void OBClient::updateStrut()
+{
+  unsigned long num = 4;
+  unsigned long *data;
+  if (!Openbox::instance->property()->get(_window,
+                                          otk::OBProperty::net_wm_strut,
+                                          otk::OBProperty::Atom_Cardinal,
+                                          &num, &data))
+    return;
+
+  if (num == 4) {
+    _strut.left = data[0];
+    _strut.right = data[1];
+    _strut.top = data[2];
+    _strut.bottom = data[3];
+    
+    Openbox::instance->screen(_screen)->updateStrut();
+  }
+
+  delete [] data;
+}
+
+
 void OBClient::propertyHandler(const XPropertyEvent &e)
 {
   otk::OtkEventHandler::propertyHandler(e);
@@ -519,6 +543,8 @@ void OBClient::propertyHandler(const XPropertyEvent &e)
   else if (e.atom == property->atom(otk::OBProperty::wm_protocols))
     updateProtocols();
   // XXX: transient for hint
+  else if (e.atom == property->atom(otk::OBProperty::net_wm_strut))
+    updateStrut();
   // XXX: strut hint
 }
 
This page took 0.02586 seconds and 4 git commands to generate.