diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-07-13 15:16:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-13 15:16:21 +0200 |
commit | d4b0944e051effc3a4fc089441011ffee6f0dc5e (patch) | |
tree | 38fec7895a3df07242dbba4b00b6171b25cbcbad | |
parent | 7e07c1ba57d1335cfc698e4c9e232454d77e9fae (diff) | |
parent | d479089211e38cd57680e40ba0def97cc5e97b7c (diff) | |
download | UXP-d4b0944e051effc3a4fc089441011ffee6f0dc5e.tar UXP-d4b0944e051effc3a4fc089441011ffee6f0dc5e.tar.gz UXP-d4b0944e051effc3a4fc089441011ffee6f0dc5e.tar.lz UXP-d4b0944e051effc3a4fc089441011ffee6f0dc5e.tar.xz UXP-d4b0944e051effc3a4fc089441011ffee6f0dc5e.zip |
Merge pull request #633 from FranklinDM/issue-336-fix
Fix issue #336: Full-screen does not initialized properly when called from an empty new tab
-rw-r--r-- | application/basilisk/base/content/browser-fullScreenAndPointerLock.js | 12 | ||||
-rw-r--r-- | application/palemoon/base/content/browser-fullScreen.js | 12 |
2 files changed, 24 insertions, 0 deletions
diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js index 497e51121..dbc9478c1 100644 --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -320,6 +320,18 @@ var FullScreen = { document.addEventListener("keypress", this._keyToggleCallback, false); document.addEventListener("popupshown", this._setPopupOpen, false); document.addEventListener("popuphidden", this._setPopupOpen, false); + // If it is not safe to collapse, add the mouse position tracker or + // else it won't be possible to hide the navigation toolbox again + if (!this._safeToCollapse()) { + let rect = gBrowser.mPanelContainer.getBoundingClientRect(); + this._mouseTargetRect = { + top: rect.top + 50, + bottom: rect.bottom, + left: rect.left, + right: rect.right + }; + MousePosTracker.addListener(this); + } // In DOM fullscreen mode, we hide toolbars with CSS if (!document.fullscreenElement) this.hideNavToolbox(true); diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js index 6afd247be..b1235a8d3 100644 --- a/application/palemoon/base/content/browser-fullScreen.js +++ b/application/palemoon/base/content/browser-fullScreen.js @@ -53,6 +53,18 @@ var FullScreen = { document.addEventListener("popupshown", this._setPopupOpen, false); document.addEventListener("popuphidden", this._setPopupOpen, false); this._shouldAnimate = true; + // If it is not safe to collapse, add the mouse position tracker or + // else it won't be possible to hide the navigation toolbox again + if (!this._safeToCollapse(document.mozFullScreen)) { + let rect = gBrowser.mPanelContainer.getBoundingClientRect(); + this._mouseTargetRect = { + top: rect.top + 50, + bottom: rect.bottom, + left: rect.left, + right: rect.right + }; + MousePosTracker.addListener(this); + } // We don't animate the toolbar collapse if in DOM full-screen mode, // as the size of the content area would still be changing after the // mozfullscreenchange event fired, which could confuse content script. |