Bug 1740389; r=handyman, a=tjr

Bug 1735071: Make Windows non-ePopupLevelTop popups respect owner z-order. r=edgar, a=tjr
This commit is contained in:
roytam1 2022-01-19 10:01:39 +08:00
commit 7d96ee2fe6

View file

@ -1587,7 +1587,20 @@ NS_IMETHODIMP nsWindow::Show(bool bState)
// the popup.
flags |= SWP_NOACTIVATE;
HWND owner = ::GetWindow(mWnd, GW_OWNER);
::SetWindowPos(mWnd, owner ? 0 : HWND_TOPMOST, 0, 0, 0, 0, flags);
if (owner) {
// ePopupLevelTop popups should be above all else. All other
// types should be placed in front of their owner, without
// changing the owner's z-level relative to other windows.
if (PopupLevel() != ePopupLevelTop) {
::SetWindowPos(mWnd, owner, 0, 0, 0, 0, flags);
::SetWindowPos(owner, mWnd, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
} else {
::SetWindowPos(mWnd, HWND_TOP, 0, 0, 0, 0, flags);
}
} else {
::SetWindowPos(mWnd, HWND_TOPMOST, 0, 0, 0, 0, flags);
}
} else {
if (mWindowType == eWindowType_dialog && !CanTakeFocus())
flags |= SWP_NOACTIVATE;
@ -3449,8 +3462,6 @@ nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen)
taskbarInfo->PrepareFullScreenHWND(mWnd, TRUE);
}
} else {
if (mSizeMode != nsSizeMode_Fullscreen)
return NS_OK;
SetSizeMode(mOldSizeMode);
}