X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fclient.cc;h=e55f681f58a7edaba152905dd4f23d8908f3fe30;hb=a7ccc544500fe84e707f6e511261276b819d8906;hp=e9136df4d0324c3294869e8af44d6cee9ef56af1;hpb=44d653e3e8d042bf3f1d68108a8197a895888da8;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index e9136df4..e55f681f 100644 --- a/src/client.cc +++ b/src/client.cc @@ -51,6 +51,8 @@ Client::Client(int screen, Window window) _urgent = false; // not positioned unless specified _positioned = false; + // nothing is disabled unless specified + _disabled_decorations = 0; getArea(); getDesktop(); @@ -218,8 +220,8 @@ void Client::setupDecorAndFunctions() _functions |= Func_Close; } - if (_min_size.x() > _max_size.x() || _min_size.y() > _max_size.y()) { - _decorations &= ~Decor_Maximize; + if (!(_min_size.x() < _max_size.x() || _min_size.y() < _max_size.y())) { + _decorations &= ~(Decor_Maximize | Decor_Handle); _functions &= ~(Func_Resize | Func_Maximize); } @@ -306,6 +308,12 @@ void Client::setupDecorAndFunctions() _decorations &= ~Decor_Close; changeAllowedActions(); + + if (frame) { + frame->adjustSize(); // change the decors on the frame + frame->adjustPosition(); // with more/less decorations, we may need to be + // moved + } } @@ -624,8 +632,11 @@ void Client::updateStrut() _strut.right = data[1]; _strut.top = data[2]; _strut.bottom = data[3]; - - openbox->screen(_screen)->updateStrut(); + + // updating here is pointless while we're being mapped cuz we're not in + // the screen's client list yet + if (frame) + openbox->screen(_screen)->updateStrut(); } delete [] data; @@ -695,7 +706,6 @@ void Client::propertyHandler(const XPropertyEvent &e) getType(); calcLayer(); // type may have changed, so update the layer setupDecorAndFunctions(); - frame->adjustSize(); // this updates the frame for any new decor settings } else if (e.atom == otk::Property::atoms.net_wm_name || e.atom == otk::Property::atoms.wm_name) @@ -708,7 +718,6 @@ void Client::propertyHandler(const XPropertyEvent &e) else if (e.atom == otk::Property::atoms.wm_protocols) { updateProtocols(); setupDecorAndFunctions(); - frame->adjustSize(); // update the decorations } else if (e.atom == otk::Property::atoms.net_wm_strut) updateStrut(); @@ -1343,8 +1352,6 @@ void Client::disableDecorations(DecorationFlags flags) { _disabled_decorations = flags; setupDecorAndFunctions(); - if (frame) - frame->adjustSize(); // change the decors on the frame }