diff options
author | Moonchild <moonchild@palemoon.org> | 2022-01-14 11:51:06 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2022-01-14 11:51:06 +0000 |
commit | 6264f83b6331d4792c9277d880cc245c8c14468d (patch) | |
tree | b6a825222cb8e7fa4357ae675ad7355138219159 /system | |
parent | 27928214e4fb9b60d3f17fbb39b7cd8cc161af36 (diff) | |
download | aura-central-6264f83b6331d4792c9277d880cc245c8c14468d.tar.gz |
[interface] Make Windows non-ePopupLevelTop popups respect owner z-order
Diffstat (limited to 'system')
-rw-r--r-- | system/interface/windows/nsWindow.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/system/interface/windows/nsWindow.cpp b/system/interface/windows/nsWindow.cpp index f77df4665..8f614d862 100644 --- a/system/interface/windows/nsWindow.cpp +++ b/system/interface/windows/nsWindow.cpp @@ -1574,7 +1574,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; |