From 5d81ad3c22666408fa57f6a5373acfaca693d277 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 27 Jul 2011 15:20:33 +0200 Subject: Solvedm problem of window not taking the default window position when created. --- xorg-server/hw/xwin/winmultiwindowwindow.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'xorg-server/hw/xwin') diff --git a/xorg-server/hw/xwin/winmultiwindowwindow.c b/xorg-server/hw/xwin/winmultiwindowwindow.c index 9bc6efdd4..c73d192f3 100644 --- a/xorg-server/hw/xwin/winmultiwindowwindow.c +++ b/xorg-server/hw/xwin/winmultiwindowwindow.c @@ -555,15 +555,20 @@ winCreateWindowsWindow (WindowPtr pWin) if (hIcon) SendMessage (hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); 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. + Do this before the next SetWindowPos because this one is generating a WM_STYLECHANGED + message which is causing a window move, which is wrong if the Xwindow does not + have the correct coordinates yet */ + if (iX == CW_USEDEFAULT) + { + winAdjustXWindow(pWin, hWnd); + } + /* Change style back to popup, already placed... */ SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); SetWindowPos (hWnd, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); - /* If we asked the native WM to place the window, synchronize the X window position */ - if (iX == CW_USEDEFAULT) - winAdjustXWindow(pWin, hWnd); - /* Make sure it gets the proper system menu for a WS_POPUP, too */ GetSystemMenu (hWnd, TRUE); -- cgit v1.2.3