X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=a2106d867749f901fa0d78d85b3cea03af65b64c;hb=7bae794382c7a64a6427b16d1339b98120a5166f;hp=95d1509562d114b6a7861d10807a7973ac10e31c;hpb=b02c91caad1ef6ddaebe8d58a410a089d47f1f59;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 95d15095..a2106d86 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 }