aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwindow.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-02-11 14:53:58 +0000
committermarha <marha@users.sourceforge.net>2011-02-11 14:53:58 +0000
commit65a037ffd87e7d89999a8a3d535c7a2b598b8b6c (patch)
treef5f62fcb9d1882be6e7c28bdcf5be64fc83b2d3a /xorg-server/hw/xwin/winmultiwindowwindow.c
parent886f645893f27515eebe3816cc7e2840cc2707e0 (diff)
downloadvcxsrv-65a037ffd87e7d89999a8a3d535c7a2b598b8b6c.tar.gz
vcxsrv-65a037ffd87e7d89999a8a3d535c7a2b598b8b6c.tar.bz2
vcxsrv-65a037ffd87e7d89999a8a3d535c7a2b598b8b6c.zip
Solved problem of a window being created with an Y coordinate of 0x8000000. This is the cause when only as Y coordinate CW_USEDEFAULT is choosen
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwindow.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwindow.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c
index 6c7debd15..b89073fc9 100644
--- a/xorg-server/hw/xwin/winmultiwindowwindow.c
+++ b/xorg-server/hw/xwin/winmultiwindowwindow.c
@@ -443,14 +443,42 @@ winCreateWindowsWindow (WindowPtr pWin)
iHeight = pWin->drawable.height;
/* If it's an InputOutput window, and so is going to end up being made visible,
- make sure the window actually ends up somewhere where it will be visible */
+ make sure the window actually ends up somewhere where it will be visible
+ Dont't do it by making just one of the two iX and iY CW_USEDEFAULT since
+ this will create a window at place CW_USEDEFAULT which is 0x80000000 */
if (pWin->drawable.class != InputOnly)
{
- if ((iX < GetSystemMetrics (SM_XVIRTUALSCREEN)) || (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN)))
- iX = CW_USEDEFAULT;
+ while (1)
+ {
+ if (iX < GetSystemMetrics (SM_XVIRTUALSCREEN))
+ {
+ iX = GetSystemMetrics (SM_XVIRTUALSCREEN);
+ ErrorF("Resetting iX to %d\n",iX);
+ }
+ else if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))
+ {
+ iX = GetSystemMetrics (SM_CXVIRTUALSCREEN)-iWidth;
+ ErrorF("Resetting iX to %d\n",iX);
+ }
+ else
+ break;
+ }
- if ((iY < GetSystemMetrics (SM_YVIRTUALSCREEN)) || (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN)))
- iY = CW_USEDEFAULT;
+ while (1)
+ {
+ if (iY < GetSystemMetrics (SM_YVIRTUALSCREEN))
+ {
+ iY = GetSystemMetrics (SM_YVIRTUALSCREEN);
+ ErrorF("Resetting iY to %d\n",iY);
+ }
+ else if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))
+ {
+ iY = GetSystemMetrics (SM_CYVIRTUALSCREEN)-iHeight;
+ ErrorF("Resetting iY to %d\n",iY);
+ }
+ else
+ break;
+ }
}
winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
@@ -517,7 +545,7 @@ winCreateWindowsWindow (WindowPtr pWin)
if (hIconSmall) SendMessage (hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall);
/* If we asked the native WM to place the window, synchronize the X window position */
- if ((iX == CW_USEDEFAULT) || (iY == CW_USEDEFAULT))
+ if (iX == CW_USEDEFAULT)
winAdjustXWindow(pWin, hWnd);
/* Change style back to popup, already placed... */