[gnome-shell/wip/exalm/gestures] don't allow scrolling for non-overview gesture



commit e9da0283522c9df735e5108dd989759eb64d0744
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Fri Jun 28 20:33:39 2019 +0500

    don't allow scrolling for non-overview gesture

 js/ui/swipeTracker.js  | 12 +++++++-----
 js/ui/windowManager.js |  2 +-
 2 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 0c54406f3..64ca02307 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -171,7 +171,7 @@ Signals.addSignalMethods(ScrollGesture.prototype);
 //   This property can be used to enable or disable the swipe tracker temporarily.
 
 var SwipeTracker = class {
-    constructor(actor, allowedModes, allowDrag = true) {
+    constructor(actor, allowedModes, allowDrag = true, allowScroll = true) {
         this._allowedModes = allowedModes;
         this._enabled = true;
 
@@ -202,13 +202,15 @@ var SwipeTracker = class {
             try {
                 actor.add_action(dragGesture);
             } catch (e) {
-                actor.addAction(dragGesture);
+                actor.addAction(dragGesture); // FIXME: wtf is this
             }
         }
 
-        let scrollGesture = new ScrollGesture(actor, shouldSkip);
-        scrollGesture.connect('update', this._updateGesture.bind(this));
-        scrollGesture.connect('end', this._endGesture.bind(this));
+        if (allowScroll) {
+            let scrollGesture = new ScrollGesture(actor, shouldSkip);
+            scrollGesture.connect('update', this._updateGesture.bind(this));
+            scrollGesture.connect('end', this._endGesture.bind(this));
+        }
     }
 
     get enabled() {
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 4d44a65e8..be6090fcd 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -926,7 +926,7 @@ var WindowManager = class {
                                                            false, -1, 1);
 
         let allowedModes = Shell.ActionMode.NORMAL;
-        let gesture = new SwipeTracker.SwipeTracker(global.stage, allowedModes, false);
+        let gesture = new SwipeTracker.SwipeTracker(global.stage, allowedModes, false, false);
         gesture.connect('begin', this._switchWorkspaceBegin.bind(this));
         gesture.connect('update', this._switchWorkspaceUpdate.bind(this));
         gesture.connect('end', this._switchWorkspaceEnd.bind(this));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]