From 784c0d656844e7613ce4fe943a189a9c4b1254a8 Mon Sep 17 00:00:00 2001 From: James Tabor Date: Thu, 10 May 2012 16:26:02 +0000 Subject: [PATCH] [Win32k] - Patch by Dmitry Timoshkov : SetParent() should use ShowWindow() to make a reparented window visible and move a window to new position. - Note: SetWindowPos should be correct, http://www.winehq.org/pipermail/wine-cvs/2012-April/086267.html svn path=/trunk/; revision=56560 --- reactos/win32ss/user/ntuser/window.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/reactos/win32ss/user/ntuser/window.c b/reactos/win32ss/user/ntuser/window.c index 1e0a2a3e799..5f661a8fa2f 100644 --- a/reactos/win32ss/user/ntuser/window.c +++ b/reactos/win32ss/user/ntuser/window.c @@ -1027,6 +1027,7 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent) { PWND WndOldParent, pWndExam; BOOL WasVisible; + POINT pt; ASSERT(Wnd); ASSERT(WndNewParent); @@ -1065,9 +1066,12 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent) WasVisible = co_WinPosShowWindow(Wnd, SW_HIDE); /* Window must belong to current process */ - if (Wnd->head.pti->pEThread->ThreadsProcess != PsGetCurrentProcess()) + if (Wnd->head.pti->ppi != PsGetCurrentProcessWin32Process()) return NULL; + pt.x = Wnd->rcWindow.left; + pt.y = Wnd->rcWindow.top; + WndOldParent = Wnd->spwndParent; if (WndOldParent) UserReferenceObject(WndOldParent); /* Caller must deref */ @@ -1091,14 +1095,10 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent) * in the z-order and send the expected WM_WINDOWPOSCHANGING and * WM_WINDOWPOSCHANGED notification messages. */ - co_WinPosSetWindowPos(Wnd, (0 == (Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST), - 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE - | (WasVisible ? SWP_SHOWWINDOW : 0)); + co_WinPosSetWindowPos( Wnd, + (0 == (Wnd->ExStyle & WS_EX_TOPMOST) ? HWND_TOP : HWND_TOPMOST), + pt.x, pt.y, 0, 0, SWP_NOSIZE ); - /* - * FIXME: A WM_MOVE is also generated (in the DefWindowProc handler - * for WM_WINDOWPOSCHANGED) in Windows, should probably remove SWP_NOMOVE. - */ if (WasVisible) co_WinPosShowWindow(Wnd, SW_SHOWNORMAL); return WndOldParent;