diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-05 20:01:10 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-04-05 20:01:10 +0200 |
commit | c3b63b831cd2c64700e875b28540212c7c881ac6 (patch) | |
tree | edd98fcbd2004d3b562904f822bf6c3322fc7f52 /application/basilisk/base/content/browser-fullScreenAndPointerLock.js | |
parent | d432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0 (diff) | |
parent | cc07da9cb4d6e7a53f8d953427ffc2bca2e0c2df (diff) | |
download | UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.gz UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.lz UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.xz UXP-c3b63b831cd2c64700e875b28540212c7c881ac6.zip |
Merge branch 'master' into 816
Diffstat (limited to 'application/basilisk/base/content/browser-fullScreenAndPointerLock.js')
-rw-r--r-- | application/basilisk/base/content/browser-fullScreenAndPointerLock.js | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js index ebe55377f..b26a31f78 100644 --- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -322,15 +322,9 @@ var FullScreen = { 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); + if (gPrefService.getBoolPref("browser.fullscreen.autohide")) { + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } // In DOM fullscreen mode, we hide toolbars with CSS if (!document.fullscreenElement) @@ -468,7 +462,8 @@ var FullScreen = { cleanup: function () { if (!window.fullScreen) { - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); document.removeEventListener("keypress", this._keyToggleCallback, false); document.removeEventListener("popupshown", this._setPopupOpen, false); document.removeEventListener("popuphidden", this._setPopupOpen, false); @@ -497,17 +492,12 @@ var FullScreen = { .getInterface(Ci.nsIDOMWindowUtils); }, - getMouseTargetRect: function() - { - return this._mouseTargetRect; - }, - // Event callbacks _expandCallback: function() { FullScreen.showNavToolbox(); }, - onMouseEnter: function() + _collapseCallback: function() { FullScreen.hideNavToolbox(); }, @@ -588,14 +578,8 @@ var FullScreen = { // Track whether mouse is near the toolbox if (trackMouse && !this.useLionFullScreen) { - let rect = gBrowser.mPanelContainer.getBoundingClientRect(); - this._mouseTargetRect = { - top: rect.top + 50, - bottom: rect.bottom, - left: rect.left, - right: rect.right - }; - MousePosTracker.addListener(this); + gBrowser.mPanelContainer.addEventListener("mousemove", + this._collapseCallback, false); } this._isChromeCollapsed = false; @@ -622,7 +606,8 @@ var FullScreen = { gNavToolbox.style.marginTop = -gNavToolbox.getBoundingClientRect().height + "px"; this._isChromeCollapsed = true; - MousePosTracker.removeListener(this); + gBrowser.mPanelContainer.removeEventListener("mousemove", + this._collapseCallback, false); }, _updateToolbars: function (aEnterFS) { |