summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2014-05-08 11:41:18 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2014-06-11 18:06:55 +0100
commita488fea8f766b5b4d4471b52a784e7fa307bdd73 (patch)
tree3b880d58ea6b8183984303813311f2864b5570e2 /hw
parent4424e4281e143eb921ade9687b3e4c7fbab32b7c (diff)
Ignore WM_NORMAL_HINTS PPosition if it is the origin
This isn't really a good solution We should probably consider _NET_WM_WINDOW_TYPE and if it's _NET_WM_TYPE_NORMAL or absent, just ignore PPosition and place the window as we like. But _NET_WM_WINDOW_TYPE isn't straightforward to get at here.
Diffstat (limited to 'hw')
-rw-r--r--hw/xwin/winmultiwindowwindow.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index a74577ed9..e99a339c9 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -590,13 +590,25 @@ winCreateWindowsTopLevelWindow(WindowPtr pWin)
}
}
else {
- /* Default positions if none specified */
- if (!winMultiWindowGetWMNormalHints(pWin, &hints))
- hints.flags = 0;
- if (!(hints.flags & (USPosition | PPosition)) &&
- !pWin->overrideRedirect) {
- iX = CW_USEDEFAULT;
- iY = CW_USEDEFAULT;
+ if (!pWin->overrideRedirect) {
+ /* Default positions if none specified */
+ if (!winMultiWindowGetWMNormalHints(pWin, &hints))
+ hints.flags = 0;
+
+ if ((hints.flags & USPosition) ||
+ ((hints.flags & PPosition) &&
+ ((pWin->drawable.x - pWin->borderWidth != 0) ||
+ (pWin->drawable.y - pWin->borderWidth != 0)))) {
+ /*
+ Always respect user specified position, respect program
+ specified position if it's not the origin
+ */
+ }
+ else {
+ /* Use default position */
+ iX = CW_USEDEFAULT;
+ iY = CW_USEDEFAULT;
+ }
}
}