summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-17 02:48:29 +0000
committerDana Jansens <danakj@orodu.net>2003-01-17 02:48:29 +0000
commitb8ae2f393f0baa17c2e5882504a938029d2933ff (patch)
tree43f5d9edc8a3f95aa13afb88323089b6018a585e /src
parent4c2f4e75372c4814413e3a105a045395e10892ca (diff)
try use the gravity in the WM_NORMAL hint, and fall back to the attribute
Diffstat (limited to 'src')
-rw-r--r--src/client.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/client.cc b/src/client.cc
index 4e44d4bc..829bec36 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -93,13 +93,21 @@ Client::~Client()
void Client::getGravity()
{
+ XSizeHints size;
XWindowAttributes wattrib;
Status ret;
-
- ret = XGetWindowAttributes(**otk::display, _window, &wattrib);
- assert(ret != BadWindow);
-
- _gravity = wattrib.win_gravity;
+ 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;
+ }
}
void Client::getDesktop()
@@ -406,7 +414,7 @@ void Client::updateNormalHints()
// if the client has a frame, i.e. has already been mapped and is
// changing its gravity
- if (frame && _gravity != oldgravity) {
+ if (_gravity != oldgravity) {
// move our idea of the client's position based on its new gravity
int x, y;
frame->frameGravity(x, y);