win32ss/user/ntuser/window.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c index 49200a53d9d..2ca03dad85f 100644 --- a/win32ss/user/ntuser/window.c +++ b/win32ss/user/ntuser/window.c @@ -1218,29 +1218,26 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent) if (WndOldParent) UserReferenceObject(WndOldParent); /* Caller must deref */ - if (WndNewParent != WndOldParent) - { - /* Unlink the window from the siblings list */ - IntUnlinkWindow(Wnd); - Wnd->ExStyle2 &= ~WS_EX2_LINKED; - - /* Set the new parent */ - WndSetParent(Wnd, WndNewParent); + /* Unlink the window from the siblings list */ + IntUnlinkWindow(Wnd); + Wnd->ExStyle2 &= ~WS_EX2_LINKED; - if ( Wnd->style & WS_CHILD && - Wnd->spwndOwner && - Wnd->spwndOwner->ExStyle & WS_EX_TOPMOST ) - { - ERR("SetParent Top Most from Pop up!\n"); - Wnd->ExStyle |= WS_EX_TOPMOST; - } + /* Set the new parent */ + WndSetParent(Wnd, WndNewParent); - /* Link the window with its new siblings */ - IntLinkHwnd( Wnd, - ((0 == (Wnd->ExStyle & WS_EX_TOPMOST) && - UserIsDesktopWindow(WndNewParent) ) ? HWND_TOP : HWND_TOPMOST ) ); + if ( Wnd->style & WS_CHILD && + Wnd->spwndOwner && + Wnd->spwndOwner->ExStyle & WS_EX_TOPMOST ) + { + ERR("SetParent Top Most from Pop up!\n"); + Wnd->ExStyle |= WS_EX_TOPMOST; } + /* Link the window with its new siblings */ + IntLinkHwnd( Wnd, + ((0 == (Wnd->ExStyle & WS_EX_TOPMOST) && + UserIsDesktopWindow(WndNewParent) ) ? HWND_TOP : HWND_TOPMOST ) ); + if ( WndNewParent == co_GetDesktopWindow(Wnd) && !(Wnd->style & WS_CLIPSIBLINGS) ) {