summaryrefslogtreecommitdiffstats
path: root/extensions/vertical-workspaces/lib/swipeTracker.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--extensions/vertical-workspaces/lib/swipeTracker.js (renamed from extensions/vertical-workspaces/swipeTracker.js)28
1 files changed, 18 insertions, 10 deletions
diff --git a/extensions/vertical-workspaces/swipeTracker.js b/extensions/vertical-workspaces/lib/swipeTracker.js
index d5c52da..d9c3407 100644
--- a/extensions/vertical-workspaces/swipeTracker.js
+++ b/extensions/vertical-workspaces/lib/swipeTracker.js
@@ -1,7 +1,7 @@
/**
- * Vertical Workspaces
+ * V-Shell (Vertical Workspaces)
* swipeTracker.js
- *
+ *
* @author GdH <G-dH@github.com>
* @copyright 2022 - 2023
* @license GPL-3.0
@@ -15,13 +15,23 @@ const Main = imports.ui.main;
const SwipeTracker = imports.ui.swipeTracker;
const Me = imports.misc.extensionUtils.getCurrentExtension();
+
let opt;
+let _firstRun = true;
let _vwGestureUpdateId;
let _originalGestureUpdateId;
function update(reset = false) {
- opt = Me.imports.settings.opt;
+ opt = Me.imports.lib.settings.opt;
+ const moduleEnabled = opt.get('swipeTrackerModule', true);
+ reset = reset || !moduleEnabled;
+
+ // don't even touch this module if disabled
+ if (_firstRun && reset)
+ return;
+
+ _firstRun = false;
if (reset || !opt.ORIENTATION) { // 1-VERTICAL, 0-HORIZONTAL
// original swipeTrackers' orientation and updateGesture function
@@ -56,11 +66,9 @@ function update(reset = false) {
}
}
-//---- SwipeTracker -----------------------------------------------------------------------------------
-// switch overview's state gesture direction
-var SwipeTrackerVertical = {
- _updateGesture: function(gesture, time, delta, distance) {
- if (this._state !== 1) //State.SCROLLING)
+const SwipeTrackerVertical = {
+ _updateGesture(gesture, time, delta, distance) {
+ if (this._state !== 1) // State.SCROLLING)
return;
if ((this._allowedModes & Main.actionMode) === 0 || !this.enabled) {
@@ -75,5 +83,5 @@ var SwipeTrackerVertical = {
this._progress = Math.clamp(this._progress, ...this._getBounds(this._initialProgress));
this.emit('update', this._progress);
- }
-}
+ },
+};