зеркало из https://github.com/mozilla/gecko-dev.git
Bug 724554 - Don't exit fullscreen on window deactivate, just warn on refocus. r=dao
This commit is contained in:
Родитель
14f320dd18
Коммит
46036de057
|
@ -88,12 +88,10 @@ var FullScreen = {
|
|||
|
||||
handleEvent: function (event) {
|
||||
switch (event.type) {
|
||||
case "deactivate":
|
||||
// We must call exitDomFullScreen asynchronously, since "deactivate" is
|
||||
// dispatched in the middle of the focus manager's window lowering code,
|
||||
// and the focus manager gets confused if we exit fullscreen mode in the
|
||||
// middle of window lowering. See bug 729872.
|
||||
setTimeout(this.exitDomFullScreen.bind(this), 0);
|
||||
case "activate":
|
||||
if (document.mozFullScreen) {
|
||||
this.showWarning(this.fullscreenDoc);
|
||||
}
|
||||
break;
|
||||
case "transitionend":
|
||||
if (event.propertyName == "opacity")
|
||||
|
@ -138,10 +136,11 @@ var FullScreen = {
|
|||
gBrowser.tabContainer.addEventListener("TabClose", this.exitDomFullScreen);
|
||||
gBrowser.tabContainer.addEventListener("TabSelect", this.exitDomFullScreen);
|
||||
|
||||
// Exit DOM full-screen mode when the browser window loses focus (ALT+TAB, etc).
|
||||
if (!this.useLionFullScreen &&
|
||||
gPrefService.getBoolPref("full-screen-api.exit-on-deactivate")) {
|
||||
window.addEventListener("deactivate", this);
|
||||
// Add listener to detect when the fullscreen window is re-focused.
|
||||
// If a fullscreen window loses focus, we show a warning when the
|
||||
// fullscreen window is refocused.
|
||||
if (!this.useLionFullScreen) {
|
||||
window.addEventListener("activate", this);
|
||||
}
|
||||
|
||||
// Cancel any "hide the toolbar" animation which is in progress, and make
|
||||
|
@ -171,7 +170,8 @@ var FullScreen = {
|
|||
gBrowser.tabContainer.removeEventListener("TabClose", this.exitDomFullScreen);
|
||||
gBrowser.tabContainer.removeEventListener("TabSelect", this.exitDomFullScreen);
|
||||
if (!this.useLionFullScreen)
|
||||
window.removeEventListener("deactivate", this);
|
||||
window.removeEventListener("activate", this);
|
||||
this.fullscreenDoc = null;
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -307,7 +307,6 @@ var FullScreen = {
|
|||
cancelWarning: function(event) {
|
||||
if (!this.warningBox)
|
||||
return;
|
||||
this.fullscreenDoc = null;
|
||||
this.warningBox.removeEventListener("transitionend", this);
|
||||
if (this.warningFadeOutTimeout) {
|
||||
clearTimeout(this.warningFadeOutTimeout);
|
||||
|
|
|
@ -397,6 +397,14 @@ window[chromehidden~="toolbar"] toolbar:not(.toolbar-primary):not(.chromeclass-m
|
|||
opacity: 0.0;
|
||||
}
|
||||
|
||||
/* When the modal fullscreen approval UI is showing, don't allow interaction
|
||||
with the page, but when we're just showing the warning upon entering
|
||||
fullscreen on an already approved page, do allow interaction with the page.
|
||||
*/
|
||||
#full-screen-warning-container:not([obscure-browser]) {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#full-screen-warning-message {
|
||||
/* We must specify a max-width, otherwise word-wrap:break-word doesn't
|
||||
work in descendant <description> and <label> elements. Bug 630864. */
|
||||
|
|
|
@ -3982,7 +3982,6 @@ pref("alerts.disableSlidingEffect", false);
|
|||
// DOM full-screen API.
|
||||
pref("full-screen-api.enabled", false);
|
||||
pref("full-screen-api.allow-trusted-requests-only", true);
|
||||
pref("full-screen-api.exit-on-deactivate", true);
|
||||
pref("full-screen-api.pointer-lock.enabled", true);
|
||||
|
||||
// DOM idle observers API
|
||||
|
|
Загрузка…
Ссылка в новой задаче