- 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
This commit is contained in:
James Tabor 2012-05-10 16:26:02 +00:00
parent 04de8061da
commit 784c0d6568

View file

@ -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;