diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-02 04:25:47 -0500 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-14 12:26:25 +0200 |
commit | 73289f53892c4c48eedf8de5a40af74ff9b55a09 (patch) | |
tree | c3991d265b47fad7c75cf45812ac1963103ccf7b /toolkit/modules/WindowDraggingUtils.jsm | |
parent | 4acc0d58cb0fa989d609972493be363c105f2594 (diff) | |
download | UXP-73289f53892c4c48eedf8de5a40af74ff9b55a09.tar UXP-73289f53892c4c48eedf8de5a40af74ff9b55a09.tar.gz UXP-73289f53892c4c48eedf8de5a40af74ff9b55a09.tar.lz UXP-73289f53892c4c48eedf8de5a40af74ff9b55a09.tar.xz UXP-73289f53892c4c48eedf8de5a40af74ff9b55a09.zip |
Issue #65 - Remove AppConstants from toolkit/modules
Except for secondscreen
Diffstat (limited to 'toolkit/modules/WindowDraggingUtils.jsm')
-rw-r--r-- | toolkit/modules/WindowDraggingUtils.jsm | 21 |
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; |