summaryrefslogtreecommitdiffstats
path: root/browser/base/content/browser-fullScreenAndPointerLock.js
diff options
context:
space:
mode:
Diffstat (limited to 'browser/base/content/browser-fullScreenAndPointerLock.js')
-rw-r--r--browser/base/content/browser-fullScreenAndPointerLock.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/browser/base/content/browser-fullScreenAndPointerLock.js b/browser/base/content/browser-fullScreenAndPointerLock.js
index 82d5727f14..cc5fefff68 100644
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
@@ -275,11 +275,24 @@ var PointerlockFsWarning = {
};
var PointerLock = {
+ _isActive: false,
+
+ /**
+ * @returns {boolean} - true if pointer lock is currently active for the
+ * associated window.
+ */
+ get isActive() {
+ return this._isActive;
+ },
+
entered(originNoSuffix) {
+ this._isActive = true;
+ Services.obs.notifyObservers(null, "pointer-lock-entered");
PointerlockFsWarning.showPointerLock(originNoSuffix);
},
exited() {
+ this._isActive = false;
PointerlockFsWarning.close("pointerlock-warning");
},
};