[gnome-shell/wip/exalm/swipes: 5/5] swipeTracker: Reset before emitting 'end' and not after




commit f48e58a81a91ca6484c706d3405b219971984bbc
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Mar 13 19:57:53 2021 +0500

    swipeTracker: Reset before emitting 'end' and not after
    
    If the actor is unmapped in the handler, the touch gesture will cancel.
    Since we haven't reset the state yet, it will still work and will actually
    cancel the gesture, so reset before that instead.
    
    Fixes overview cancelling when trying to open it with a swipe.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1731>

 js/ui/swipeTracker.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 8f80bfb3e3..9c3671d3cf 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -741,8 +741,8 @@ var SwipeTracker = GObject.registerClass({
         if (duration > 0)
             duration = Math.clamp(duration, MIN_ANIMATION_DURATION, maxDuration);
 
-        this.emit('end', duration, endProgress);
         this._reset();
+        this.emit('end', duration, endProgress);
     }
 
     _cancelTouchGesture(_gesture, time, distance) {


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