]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
better focus passing around for now
[chaz/openbox] / src / client.cc
index 95d1509562d114b6a7861d10807a7973ac10e31c..381305f75cf4962de8198f1f322cc491a6a04a0b 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
 }
 
@@ -940,6 +966,22 @@ void OBClient::changeState()
   
 }
 
+
+void OBClient::setStackLayer(int l)
+{
+  if (l == 0)
+    _above = _below = false;  // normal
+  else if (l > 0) {
+    _above = true;
+    _below = false; // above
+  } else {
+    _above = false;
+    _below = true;  // below
+  }
+  changeState();
+}
+
+
 void OBClient::shade(bool shade)
 {
   if (shade == _shaded) return; // already done
This page took 0.022618 seconds and 4 git commands to generate.