diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2009-06-19 21:14:39 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-02-05 18:17:32 +0000 |
commit | fd8a32baba77aba8d124658a19f4f6eda79e49c6 (patch) | |
tree | 1f8e1a5b0a7ad720a0f563e3bd2184a1cc2ee8c2 | |
parent | 7eb840fd42bc62d88fb4fcf6600546c9ff6e56be (diff) |
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 <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r-- | hw/xwin/winmultiwindowwindow.c | 7 |
1 files changed, 7 insertions, 0 deletions
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) |