From e2908de4a023410ee6b72ccc5c439f96deaeeac1 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 5 Jan 2010 16:05:20 +0000 Subject: Multiwindow: solved problem of window not having the correct size. --- xorg-server/hw/xwin/winmultiwindowwindow.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c index a3ac6466a..6e5df2b3a 100644 --- a/xorg-server/hw/xwin/winmultiwindowwindow.c +++ b/xorg-server/hw/xwin/winmultiwindowwindow.c @@ -408,6 +408,19 @@ 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 */ @@ -496,6 +509,8 @@ 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); -- cgit v1.2.3