diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-18 13:38:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-06-18 13:38:09 +0000 |
commit | 7f9c96a5a1e619c03bf81c8b3783703b780edaf4 (patch) | |
tree | ba7cd337e9890761eb7b30f97e19a37db15de4c4 /extensions/vertical-workspaces/lib/swipeTracker.js | |
parent | Adding upstream version 20230205. (diff) | |
download | gnome-shell-extensions-extra-7f9c96a5a1e619c03bf81c8b3783703b780edaf4.tar.xz gnome-shell-extensions-extra-7f9c96a5a1e619c03bf81c8b3783703b780edaf4.zip |
Adding upstream version 20230618.upstream/20230618
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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); - } -} + }, +}; |