Bug 1707379 - Don't re-show visible windows, in order to avoid unintended window ordering changes on focus. r=spohl

This primarily affects alternative window managers which allow focusing background windows.

Differential Revision: https://phabricator.services.mozilla.com/D134778
This commit is contained in:
Markus Stange 2022-01-06 17:25:33 +00:00
Родитель 2b968a8e5e
Коммит 95c4aaa969
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -780,12 +780,12 @@ void nsCocoaWindow::Show(bool bState) {
if (!mWindow) return;
// We need to re-execute sometimes in order to bring already-visible
// windows forward.
if (!mSheetNeedsShow && !bState && ![mWindow isVisible]) return;
// Protect against re-entering.
if (bState && [mWindow isBeingShown]) return;
if (!mSheetNeedsShow) {
// Early exit if our current visibility state is already the requested state.
if (bState == ([mWindow isVisible] || [mWindow isBeingShown])) {
return;
}
}
[mWindow setBeingShown:bState];
if (bState && !mWasShown) {