X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient.cc;h=381305f75cf4962de8198f1f322cc491a6a04a0b;hb=056ff3b50cddd39b6f45969c17611dc3bf396ae9;hp=95d1509562d114b6a7861d10807a7973ac10e31c;hpb=b02c91caad1ef6ddaebe8d58a410a089d47f1f59;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 95d15095..381305f7 100644 --- a/src/client.cc +++ b/src/client.cc @@ -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