From a488fea8f766b5b4d4471b52a784e7fa307bdd73 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 8 May 2014 11:41:18 +0100 Subject: 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. --- hw/xwin/winmultiwindowwindow.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'hw') 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; + } } } -- cgit v1.2.3