X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=1c411adb7893b58bb50a4a3eb688e478d8c160c3;hb=a38a8f0bac02d9f615b769026fd72567c1ac6c91;hp=d005a0bdaad5acf032c5c04ea9bec24170bfa427;hpb=2b0897234fe041bac66c28f4a3b75d67d55991d7;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index d005a0bd..1c411adb 100644 --- a/src/client.cc +++ b/src/client.cc @@ -47,7 +47,6 @@ Client::Client(int screen, Window window) // pick a layer to start from _layer = Layer_Normal; - getGravity(); getArea(); getDesktop(); @@ -61,6 +60,8 @@ Client::Client(int screen, Window window) getShaped(); updateProtocols(); + getGravity(); // get the attribute gravity + updateNormalHints(); // this may override the attribute gravity updateWMHints(); updateTitle(); updateIconTitle(); @@ -93,21 +94,12 @@ Client::~Client() void Client::getGravity() { - XSizeHints size; XWindowAttributes wattrib; Status ret; - long junk; - - if (XGetWMNormalHints(**otk::display, _window, &size, &junk) && - size.flags & PWinGravity) { - // first try the normal hints - _gravity = size.win_gravity; - } else { - // then fall back to the attribute - ret = XGetWindowAttributes(**otk::display, _window, &wattrib); - assert(ret != BadWindow); - _gravity = wattrib.win_gravity; - } + + ret = XGetWindowAttributes(**otk::display, _window, &wattrib); + assert(ret != BadWindow); + _gravity = wattrib.win_gravity; } @@ -415,7 +407,7 @@ void Client::updateNormalHints() // if the client has a frame, i.e. has already been mapped and is // changing its gravity - if (_gravity != oldgravity) { + if (frame && _gravity != oldgravity) { // move our idea of the client's position based on its new gravity int x, y; frame->frameGravity(x, y);