// pick a layer to start from
_layer = Layer_Normal;
+ getGravity();
getArea();
getDesktop();
getShaped();
updateProtocols();
- updateNormalHints();
updateWMHints();
updateTitle();
updateIconTitle();
}
+void Client::getGravity()
+{
+ XWindowAttributes wattrib;
+ Status ret;
+
+ ret = XGetWindowAttributes(**otk::display, _window, &wattrib);
+ assert(ret != BadWindow);
+
+ _gravity = wattrib.win_gravity;
+}
+
void Client::getDesktop()
{
// defaults to the current desktop
int oldgravity = _gravity;
// defaults
- _gravity = NorthWestGravity;
_size_inc.setPoint(1, 1);
_base_size.setPoint(0, 0);
_min_size.setPoint(0, 0);
if (XGetWMNormalHints(**otk::display, _window, &size, &ret)) {
_positioned = (size.flags & (PPosition|USPosition));
- if (size.flags & PWinGravity)
+ if (size.flags & PWinGravity) {
_gravity = size.win_gravity;
+
+ // if the client has a frame, i.e. has already been mapped and is
+ // changing its gravity
+ if (frame && _gravity != oldgravity) {
+ // move our idea of the client's position based on its new gravity
+ int x, y;
+ frame->frameGravity(x, y);
+ _area.setPos(x, y);
+ }
+ }
if (size.flags & PMinSize)
_min_size.setPoint(size.min_width, size.min_height);
if (size.flags & PResizeInc)
_size_inc.setPoint(size.width_inc, size.height_inc);
}
-
- // if the client has a frame, i.e. has already been mapped and is
- // changing its gravity
- if (frame && _gravity != oldgravity) {
- // move our idea of the client's position based on its new gravity
- int x, y;
- frame->frameGravity(x, y);
- _area.setPos(x, y);
- }
}