diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2014-05-08 11:41:18 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2015-11-03 17:15:05 +0000 |
commit | 4f9b3823c9cf2940d0a93d9161a3d9f0350662b4 (patch) | |
tree | b9dcef41ce8948d8496f80fb8c9a2e211c3c55af | |
parent | 3f0cb9d67b1595d38f1baa2b4400e8839e003d57 (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.
-rw-r--r-- | hw/xwin/winmultiwindowwindow.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 0c3432e43..9cd1c862c 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -591,13 +591,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; + } } } |