diff --git "a/win32ss/user/ntuser/window.c" "b/win32ss/user/ntuser/window.c" index d67cad4d044..eb8b6ba0776 100644 --- "a/win32ss/user/ntuser/window.c" +++ "b/win32ss/user/ntuser/window.c" @@ -1221,28 +1221,36 @@ co_IntSetParent(PWND Wnd, PWND WndNewParent) if (WndOldParent) UserReferenceObject(WndOldParent); /* Caller must deref */ - /* Even if WndNewParent == WndOldParent continue because the - * child window (Wnd) should be moved to the top of the z-order */ + /* Both of these seem to fix wordpad and peazip. Which is better? */ +#if 0 + if (WndNewParent->ExStyle & WS_EX_CONTROLPARENT) +#else + if (Wnd->style & WS_CLIPCHILDREN) +#endif + { + /* Even if WndNewParent == WndOldParent continue because the + * child window (Wnd) should be moved to the top of the z-order */ - /* Unlink the window from the siblings list */ - IntUnlinkWindow(Wnd); - Wnd->ExStyle2 &= ~WS_EX2_LINKED; + /* Unlink the window from the siblings list */ + IntUnlinkWindow(Wnd); + Wnd->ExStyle2 &= ~WS_EX2_LINKED; - /* Set the new parent */ - WndSetParent(Wnd, WndNewParent); + /* Set the new parent */ + WndSetParent(Wnd, WndNewParent); - 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; - } + 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)); + /* 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) )