[gnome-shell] workspacesView: Disable swipe tracker when animating from overview



commit c57a299d5705353c5b44567a3f508532a824902d
Author: Sebastian Keller <skeller gnome org>
Date:   Wed Jan 13 23:24:49 2021 +0100

    workspacesView: Disable swipe tracker when animating from overview
    
    It was possible to switch workspaces by quickly dragging the workspace
    immediately after clicking on a window during the transition from the
    overview. This is unlikely something that is intentionally used but can
    be confusing and look bad when triggered accidentally.
    
    Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2993
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1578>

 js/ui/workspacesView.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 70b4dd5692..c57129e508 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -419,6 +419,7 @@ class WorkspacesDisplay extends St.Widget {
         this._actualGeometry = null;
         this._inWindowDrag = false;
         this._inWindowFade = false;
+        this._leavingOverview = false;
 
         this._gestureActive = false; // touch(pad) gestures
         this._canScroll = true; // limiting scrolling speed
@@ -467,7 +468,10 @@ class WorkspacesDisplay extends St.Widget {
     }
 
     _updateSwipeTracker() {
-        this._swipeTracker.enabled = this.mapped && !this._inWindowDrag;
+        this._swipeTracker.enabled =
+            this.mapped &&
+            !this._inWindowDrag &&
+            !this._leavingOverview;
     }
 
     _workspacesReordered() {
@@ -603,6 +607,9 @@ class WorkspacesDisplay extends St.Widget {
 
         this._inWindowFade = fadeOnPrimary;
 
+        this._leavingOverview = true;
+        this._updateSwipeTracker();
+
         const { primaryIndex } = Main.layoutManager;
         const { x, y, width, height } =
             Main.layoutManager.getWorkAreaForMonitor(primaryIndex);
@@ -630,6 +637,8 @@ class WorkspacesDisplay extends St.Widget {
             this._workspacesViews[i].destroy();
         this._workspacesViews = [];
 
+        this._leavingOverview = false;
+
         super.vfunc_hide();
     }
 


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