[gnome-shell/wip/jimmac/dash-icon-spacing: 25/72] workspacesView: Bind snap adjustment to workspace state adjustment




commit f28e871436421b9559e70aada76f463f6828bf7f
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jan 1 13:10:19 2021 -0300

    workspacesView: Bind snap adjustment to workspace state adjustment
    
    Bind the state adjustment of WorkspacesView's workspaces to the snap
    adjustment. Extra workspaces still run the zoom animations as before.

 js/ui/workspace.js      |  4 ++++
 js/ui/workspacesView.js | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 76ed4717b4..0f95d2e6c5 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -1424,4 +1424,8 @@ class Workspace extends St.Widget {
 
         return false;
     }
+
+    get stateAdjustment() {
+        return this.layout_manager.stateAdjustment;
+    }
 });
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 55291e6548..2be70aedaa 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -294,13 +294,13 @@ class WorkspacesView extends WorkspacesViewBase {
     }
 
     animateToOverview() {
-        for (let w = 0; w < this._workspaces.length; w++)
-            this._workspaces[w].zoomToOverview();
+        // Do nothing since the workspace adjustment is binded to
+        // the snap adjustment
     }
 
     animateFromOverview() {
         for (let w = 0; w < this._workspaces.length; w++)
-            this._workspaces[w].zoomFromOverview();
+            this._workspaces[w].prepareToLeaveOverview();
     }
 
     syncStacking(stackIndices) {
@@ -339,6 +339,10 @@ class WorkspacesView extends WorkspacesViewBase {
                     const index = this._workspaces.indexOf(workspace);
                     this._updateWorkspacesScale(index, true);
                 });
+
+                this._snapAdjustment.bind_property('value',
+                    workspace.stateAdjustment, 'value',
+                    GObject.BindingFlags.SYNC_CREATE);
             } else  {
                 workspace = this._workspaces[j];
 


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