summaryrefslogtreecommitdiffstats
path: root/dom/base/nsFocusManager.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-03-18 21:15:10 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 13:10:23 +0200
commit3aae828871ac19c4b510a7213a6401b4d751f5ef (patch)
treef6965b51be8ad25f80b8f31d99c2745dda2c769f /dom/base/nsFocusManager.cpp
parente7514afc7c13516cdd56e8ffba4399c7c1c974ba (diff)
downloadUXP-3aae828871ac19c4b510a7213a6401b4d751f5ef.tar
UXP-3aae828871ac19c4b510a7213a6401b4d751f5ef.tar.gz
UXP-3aae828871ac19c4b510a7213a6401b4d751f5ef.tar.lz
UXP-3aae828871ac19c4b510a7213a6401b4d751f5ef.tar.xz
UXP-3aae828871ac19c4b510a7213a6401b4d751f5ef.zip
[DOM] Make sure to exit fullscreen mode if popups are opened or focused.
Diffstat (limited to 'dom/base/nsFocusManager.cpp')
-rw-r--r--dom/base/nsFocusManager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
index fb350fa12..01c1944be 100644
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1261,6 +1261,15 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags,
isElementInActiveWindow = (mActiveWindow && newRootWindow == mActiveWindow);
}
+ // Exit fullscreen if a website focuses another window
+ if (!isElementInActiveWindow && aFlags & FLAG_RAISE) {
+ if (nsIDocument* doc = mActiveWindow ? mActiveWindow->GetDoc() : nullptr) {
+ if (doc && doc->GetFullscreenElement()) {
+ nsIDocument::AsyncExitFullscreen(doc);
+ }
+ }
+ }
+
// Exit fullscreen if we're focusing a windowed plugin on a non-MacOSX
// system. We don't control event dispatch to windowed plugins on non-MacOSX,
// so we can't display the "Press ESC to leave fullscreen mode" warning on