[gnome-shell] workspacesView: Treat 'gesture-cancel' the same as 'gesture-end'



commit 420f0109ee0de80982702b1ee397d4c0c7ad73df
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Feb 20 08:23:51 2013 +0100

    workspacesView: Treat 'gesture-cancel' the same as 'gesture-end'
    
    When a swipe scroll completes, we scroll the active workspace into
    view. This works fine if the gesture is completed properly by
    emitting 'gesture-end', but not when Clutter considers the gesture
    cancelled - in that case, the view remains stuck in an intermediate
    position. To fix, treat 'gesture-cancel' the same as 'gesture-end'.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689394

 js/ui/workspacesView.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 8bb589f..605f8a1 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -442,6 +442,11 @@ const WorkspacesDisplay = new Lang.Class({
                 this._workspacesViews[i].startSwipeScroll();
             return true;
         }));
+        panAction.connect('gesture-cancel', Lang.bind(this, function() {
+            clickAction.release();
+            for (let i = 0; i < this._workspacesViews.length; i++)
+                this._workspacesViews[i].endSwipeScroll();
+        }));
         panAction.connect('gesture-end', Lang.bind(this, function() {
             clickAction.release();
             for (let i = 0; i < this._workspacesViews.length; i++)


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