summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/WindowDraggingUtils.jsm
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-02 04:25:47 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-02-02 04:25:47 -0500
commit6a3907dae474c7e1f31df13a26605278d3500a0d (patch)
treeea2edc8f5df02710226259f57ea412789d979dac /toolkit/modules/WindowDraggingUtils.jsm
parent7d21d02d532fed5613501de63f8b3d50144a751f (diff)
downloadUXP-6a3907dae474c7e1f31df13a26605278d3500a0d.tar
UXP-6a3907dae474c7e1f31df13a26605278d3500a0d.tar.gz
UXP-6a3907dae474c7e1f31df13a26605278d3500a0d.tar.lz
UXP-6a3907dae474c7e1f31df13a26605278d3500a0d.tar.xz
UXP-6a3907dae474c7e1f31df13a26605278d3500a0d.zip
Issue #65 - Remove AppConstants from toolkit/modules
Except for secondscreen
Diffstat (limited to 'toolkit/modules/WindowDraggingUtils.jsm')
-rw-r--r--toolkit/modules/WindowDraggingUtils.jsm21
1 files changed, 12 insertions, 9 deletions
diff --git a/toolkit/modules/WindowDraggingUtils.jsm b/toolkit/modules/WindowDraggingUtils.jsm
index 0cc2e88e9..a7986c8b4 100644
--- a/toolkit/modules/WindowDraggingUtils.jsm
+++ b/toolkit/modules/WindowDraggingUtils.jsm
@@ -2,9 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-
-const HAVE_CSS_WINDOW_DRAG_SUPPORT = ["win", "macosx"].includes(AppConstants.platform);
+#if defined(XP_WIN) || defined(XP_MACOSX)
+const HAVE_CSS_WINDOW_DRAG_SUPPORT = true;
+#else
+const HAVE_CSS_WINDOW_DRAG_SUPPORT = false;
+#endif
this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ];
@@ -62,12 +64,13 @@ WindowDraggingElement.prototype = {
if (!this.shouldDrag(aEvent))
return;
- if (/^gtk/i.test(AppConstants.MOZ_WIDGET_TOOLKIT)) {
- // On GTK, there is a toolkit-level function which handles
- // window dragging, which must be used.
- this._window.beginWindowMove(aEvent, isPanel ? this._elem : null);
- break;
- }
+#ifdef MOZ_WIDGET_GTK
+ // On GTK, there is a toolkit-level function which handles
+ // window dragging, which must be used.
+ this._window.beginWindowMove(aEvent, isPanel ? this._elem : null);
+ break;
+#endif
+
if (isPanel) {
let screenRect = this._elem.getOuterScreenRect();
this._deltaX = aEvent.screenX - screenRect.left;