From fd8a32baba77aba8d124658a19f4f6eda79e49c6 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 19 Jun 2009 21:14:39 +0100 Subject: Cygwin/X: Window placement refinement for multiwindow mode Window placement refinement for multiwindow mode, ensure a window actually ends up somewhere visible if it tries to create itself offscreen (which can happen for e.g. if it has a stored position from a different sized display) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwindow.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c index 8b91296f7..87ffc6d6b 100644 --- a/hw/xwin/winmultiwindowwindow.c +++ b/hw/xwin/winmultiwindowwindow.c @@ -515,6 +515,13 @@ winCreateWindowsWindow (WindowPtr pWin) iWidth = pWin->drawable.width; iHeight = pWin->drawable.height; + /* ensure window actually ends up somewhere visible */ + if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN)) + iX = CW_USEDEFAULT; + + if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN)) + iY = CW_USEDEFAULT; + if (winMultiWindowGetTransientFor (pWin, &pDaddy)) { if (pDaddy) -- cgit v1.2.3