[gnome-shell/wip/carlosg/spurious-window-drags: 1/4] swipeTracker: Use given actor for 3fg touch gesture




commit 09ea3a494d61980f58837ad258515dfe9755b469
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Oct 4 17:52:39 2022 +0200

    swipeTracker: Use given actor for 3fg touch gesture
    
    Just like the other gestures, ensure it is connected to the
    requested actor instead of the stage. Also handle its disconnection
    on SwipeTracker destruction.
    
    Fixes the OSK emoji panel SwipeTracker unintendedly handling touch
    input while the OSK is not visible.

 js/ui/swipeTracker.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 869f977c55..7de8b38d63 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -470,6 +470,7 @@ var SwipeTracker = GObject.registerClass({
         this._distance = global.screen_height;
         this._history = new EventHistory();
         this._reset();
+        this._actor = actor;
 
         this._touchpadGesture = new TouchpadSwipeGesture(allowedModes);
         this._touchpadGesture.connect('begin', this._beginGesture.bind(this));
@@ -490,7 +491,7 @@ var SwipeTracker = GObject.registerClass({
         this.bind_property('orientation', this._touchGesture, 'orientation',
             GObject.BindingFlags.SYNC_CREATE);
         this.bind_property('distance', this._touchGesture, 'distance', 0);
-        global.stage.add_action_full('swipe', Clutter.EventPhase.CAPTURE, this._touchGesture);
+        actor.add_action_full('swipe', Clutter.EventPhase.CAPTURE, this._touchGesture);
 
         if (params.allowDrag) {
             this._dragGesture = new TouchSwipeGesture(allowedModes, 1,
@@ -780,7 +781,7 @@ var SwipeTracker = GObject.registerClass({
         }
 
         if (this._touchGesture) {
-            global.stage.remove_action(this._touchGesture);
+            this._actor.remove_action(this._touchGesture);
             delete this._touchGesture;
         }
     }


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