aboutsummaryrefslogtreecommitdiff
path: root/xorg-server
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-03 07:50:12 +0000
committermarha <marha@users.sourceforge.net>2010-09-03 07:50:12 +0000
commit4d629eeaca9f0549e422abe330b8a244727d7899 (patch)
tree2aa2157f4d9207c55d17f8db0b640e6426078df6 /xorg-server
parent8e79f11d346ea250c35206d08c62831895093ee6 (diff)
downloadvcxsrv-4d629eeaca9f0549e422abe330b8a244727d7899.tar.gz
vcxsrv-4d629eeaca9f0549e422abe330b8a244727d7899.tar.bz2
vcxsrv-4d629eeaca9f0549e422abe330b8a244727d7899.zip
Immediately create the correct window size
Diffstat (limited to 'xorg-server')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwindow.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c
index 80cae7636..c318f77ad 100644
--- a/xorg-server/hw/xwin/winmultiwindowwindow.c
+++ b/xorg-server/hw/xwin/winmultiwindowwindow.c
@@ -409,19 +409,6 @@ winRestackWindowMultiWindow (WindowPtr pWin, WindowPtr pOldNextSib)
}
-static void ClientResize(HWND hWnd, int nWidth, int nHeight)
-{
- RECT rcClient, rcWindow;
- POINT ptDiff;
-
- GetClientRect(hWnd, &rcClient);
- GetWindowRect(hWnd, &rcWindow);
- ptDiff.x = (rcWindow.right - rcWindow.left) - rcClient.right;
- ptDiff.y = (rcWindow.bottom - rcWindow.top) - rcClient.bottom;
- MoveWindow(hWnd,rcWindow.left, rcWindow.top, nWidth + ptDiff.x, nHeight + ptDiff.y, TRUE);
-}
-
-
/*
* winCreateWindowsWindow - Create a Windows window associated with an X window
*/
@@ -440,6 +427,9 @@ winCreateWindowsWindow (WindowPtr pWin)
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints;
WindowPtr pDaddy;
+ DWORD dwStyle;
+ DWORD dwExStyle;
+ RECT rc;
winInitMultiWindowClass();
@@ -482,10 +472,24 @@ winCreateWindowsWindow (WindowPtr pWin)
/* Create the window */
/* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
/* CW_USEDEFAULT, change back to popup after creation */
- hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
+
+ dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+ dwExStyle = WS_EX_TOOLWINDOW;
+ rc;
+ rc.top = 0;
+ rc.left = 0;
+ rc.bottom = iHeight;
+ rc.right = iWidth;
+ AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
+ iHeight = rc.bottom - rc.top;
+ iWidth = rc.right - rc.left;
+
+ winDebug("winCreateWindowsWindow - window size %dx%d\n", iWidth, iHeight);
+
+ hWnd = CreateWindowExA (dwExStyle, /* Extended styles */
WINDOW_CLASS_X, /* Class name */
WINDOW_TITLE_X, /* Window name */
- WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ dwStyle, /* Styles */
iX, /* Horizontal position */
iY, /* Vertical position */
iWidth, /* Right edge */
@@ -517,8 +521,6 @@ winCreateWindowsWindow (WindowPtr pWin)
/* Make sure it gets the proper system menu for a WS_POPUP, too */
GetSystemMenu (hWnd, TRUE);
- ClientResize(hWnd,iWidth,iHeight);
-
/* Cause any .XWinrc menus to be added in main WNDPROC */
PostMessage (hWnd, WM_INIT_SYS_MENU, 0, 0);