mirror of
https://github.com/reactos/reactos.git
synced 2024-09-06 02:37:06 +00:00
[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
This commit is contained in:
parent
04de8061da
commit
784c0d6568
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue