From 368aba9ea0b5c4f14c14db4e6c92fd5b7260eeda Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Thu, 14 May 2015 13:14:47 +1200 Subject: [PATCH] Bug 1162752 - Prevent collapsing toolbar on fullscreen mode on OS X >= Lion. r=dao --HG-- extra : source : 1599374bea7abb66c6de302284e76edf48b97cba --- browser/base/content/browser-fullScreen.js | 28 +++++++--------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/browser/base/content/browser-fullScreen.js b/browser/base/content/browser-fullScreen.js index c74943b352f4..4390510483b9 100644 --- a/browser/base/content/browser-fullScreen.js +++ b/browser/base/content/browser-fullScreen.js @@ -50,21 +50,6 @@ var FullScreen = { this._fullScrToggler.addEventListener("dragenter", this._expandCallback, false); } - // On OS X Lion we don't want to hide toolbars when entering fullscreen, unless - // we're entering DOM fullscreen, in which case we should hide the toolbars. - // If we're leaving fullscreen, then we'll go through the exit code below to - // make sure toolbars are made visible in the case of DOM fullscreen. - if (enterFS && this.useLionFullScreen) { - if (document.mozFullScreen) { - this.showXULChrome("toolbar", false); - } - else { - gNavToolbox.setAttribute("inFullscreen", true); - document.documentElement.setAttribute("inFullscreen", true); - } - return; - } - // show/hide menubars, toolbars (except the full screen toolbar) this.showXULChrome("toolbar", !enterFS); @@ -238,9 +223,14 @@ var FullScreen = { if (!gPrefService.getBoolPref("browser.fullscreen.autohide")) return false; - // a popup menu is open in chrome: don't collapse chrome - if (!forceHide && this._isPopupOpen) - return false; + if (!forceHide) { + // a popup menu is open in chrome: don't collapse chrome + if (this._isPopupOpen) + return false; + // On OS X Lion we don't want to hide toolbars. + if (this.useLionFullScreen) + return false; + } // a textbox in chrome is focused (location bar anyone?): don't collapse chrome if (document.commandDispatcher.focusedElement && @@ -448,7 +438,7 @@ var FullScreen = { // Track whether mouse is near the toolbox this._isChromeCollapsed = false; - if (trackMouse) { + if (trackMouse && !this.useLionFullScreen) { let rect = gBrowser.mPanelContainer.getBoundingClientRect(); this._mouseTargetRect = { top: rect.top + 50,