get all the normal hints when mapping again, oops.

This commit is contained in:
Dana Jansens 2003-01-17 03:03:18 +00:00
parent 2b0897234f
commit 6a73cff16d

View file

@ -47,7 +47,6 @@ Client::Client(int screen, Window window)
// pick a layer to start from // pick a layer to start from
_layer = Layer_Normal; _layer = Layer_Normal;
getGravity();
getArea(); getArea();
getDesktop(); getDesktop();
@ -61,6 +60,8 @@ Client::Client(int screen, Window window)
getShaped(); getShaped();
updateProtocols(); updateProtocols();
getGravity(); // get the attribute gravity
updateNormalHints(); // this may override the attribute gravity
updateWMHints(); updateWMHints();
updateTitle(); updateTitle();
updateIconTitle(); updateIconTitle();
@ -93,21 +94,12 @@ Client::~Client()
void Client::getGravity() void Client::getGravity()
{ {
XSizeHints size;
XWindowAttributes wattrib; XWindowAttributes wattrib;
Status ret; Status ret;
long junk;
if (XGetWMNormalHints(**otk::display, _window, &size, &junk) && ret = XGetWindowAttributes(**otk::display, _window, &wattrib);
size.flags & PWinGravity) { assert(ret != BadWindow);
// first try the normal hints _gravity = wattrib.win_gravity;
_gravity = size.win_gravity;
} else {
// then fall back to the attribute
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 // if the client has a frame, i.e. has already been mapped and is
// changing its gravity // changing its gravity
if (_gravity != oldgravity) { if (frame && _gravity != oldgravity) {
// move our idea of the client's position based on its new gravity // move our idea of the client's position based on its new gravity
int x, y; int x, y;
frame->frameGravity(x, y); frame->frameGravity(x, y);