[gnome-shell/wip/workspace: 5/9] workspacesView: Don't zoom based on a signal



commit 8aae1d5936a1ab44b83438520540be331344b8e2
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 11 12:21:28 2013 -0400

    workspacesView: Don't zoom based on a signal

 js/ui/workspacesView.js |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index fabfeff..e85fb51 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -73,18 +73,6 @@ const WorkspacesView = new Lang.Class({
         this._updateExtraWorkspaces();
         this._updateExtraWorkspacesId = this._settings.connect('changed::workspaces-only-on-primary', 
Lang.bind(this, this._updateExtraWorkspaces));
 
-        // Position/scale the desktop windows and their children after the
-        // workspaces have been created. This cannot be done first because
-        // window movement depends on the Workspaces object being accessible
-        // as an Overview member.
-        this._overviewShowingId =
-            Main.overview.connect('showing',
-                                 Lang.bind(this, function() {
-                for (let w = 0; w < this._workspaces.length; w++)
-                    this._workspaces[w].zoomToOverview();
-                for (let w = 0; w < this._extraWorkspaces.length; w++)
-                    this._extraWorkspaces[w].zoomToOverview();
-        }));
         this._overviewShownId =
             Main.overview.connect('shown',
                                  Lang.bind(this, function() {
@@ -153,7 +141,14 @@ const WorkspacesView = new Lang.Class({
         return this._workspaces[active];
     },
 
-    hide: function() {
+    zoomToOverview: function() {
+        for (let w = 0; w < this._workspaces.length; w++)
+            this._workspaces[w].zoomToOverview();
+        for (let w = 0; w < this._extraWorkspaces.length; w++)
+            this._extraWorkspaces[w].zoomToOverview();
+    },
+
+    zoomFromOverview: function() {
         this.actor.remove_clip();
 
         for (let w = 0; w < this._workspaces.length; w++)
@@ -289,7 +284,6 @@ const WorkspacesView = new Lang.Class({
     _onDestroy: function() {
         this._destroyExtraWorkspaces();
         this.scrollAdjustment.run_dispose();
-        Main.overview.disconnect(this._overviewShowingId);
         Main.overview.disconnect(this._overviewShownId);
         global.window_manager.disconnect(this._switchWorkspaceNotifyId);
         global.screen.disconnect(this._updateWorkspacesId);
@@ -479,6 +473,8 @@ const WorkspacesDisplay = new Lang.Class({
 
     show: function() {
         this._updateWorkspacesViews();
+        for (let i = 0; i < this._workspacesViews.length; i++)
+            this._workspacesViews[i].zoomToOverview();
 
         this._restackedNotifyId =
             Main.overview.connect('windows-restacked',
@@ -488,9 +484,8 @@ const WorkspacesDisplay = new Lang.Class({
     },
 
     zoomFromOverview: function() {
-        for (let i = 0; i < this._workspacesViews.length; i++) {
-            this._workspacesViews[i].hide();
-        }
+        for (let i = 0; i < this._workspacesViews.length; i++)
+            this._workspacesViews[i].zoomFromOverview();
     },
 
     hide: function() {


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