[gnome-shell] workspace: Don't save the current layout



commit e981cae27c201dc6a1f43916ed89b6f8226affd9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Feb 25 16:56:11 2013 -0500

    workspace: Don't save the current layout
    
    This was saved so that doing something which called relayout
    but only changed the area rectangle would simply be needed to
    recompute window scaling parameters. With the new overview
    relayout, the flow control changed, it turns out that the
    current layout is always cleared. Remove this for now, and we'll
    put in a different strategy for this.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694469

 js/ui/workspace.js | 31 ++-----------------------------
 1 file changed, 2 insertions(+), 29 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 3218329..338d0b9 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -947,8 +947,6 @@ const Workspace = new Lang.Class({
 
         this._positionWindowsFlags = 0;
         this._positionWindowsId = 0;
-
-        this._currentLayout = null;
     },
 
     setGeometry: function(x, y, width, height) {
@@ -991,7 +989,6 @@ const Workspace = new Lang.Class({
             clone = null;
 
         this._reservedSlot = clone;
-        this._currentLayout = null;
         this.positionWindows(WindowPositionFlags.ANIMATE);
     },
 
@@ -1220,7 +1217,6 @@ const Workspace = new Lang.Class({
         this._cursorX = x;
         this._cursorY = y;
 
-        this._currentLayout = null;
         this._repositionWindowsId = Mainloop.timeout_add(750,
             Lang.bind(this, this._delayedWindowRepositioning));
     },
@@ -1268,7 +1264,6 @@ const Workspace = new Lang.Class({
             clone.overlay.relayout(false);
         }
 
-        this._currentLayout = null;
         this.positionWindows(WindowPositionFlags.ANIMATE);
     },
 
@@ -1306,8 +1301,6 @@ const Workspace = new Lang.Class({
 
     // Animate the full-screen to Overview transition.
     zoomToOverview : function() {
-        this._currentLayout = null;
-
         // Position and scale the windows.
         if (Main.overview.animationInProgress)
             this.positionWindows(WindowPositionFlags.ANIMATE | WindowPositionFlags.INITIAL);
@@ -1515,16 +1508,6 @@ const Workspace = new Lang.Class({
         return lastLayout;
     },
 
-    _rectEqual: function(one, two) {
-        if (one == two)
-            return true;
-
-        return (one.x == two.x &&
-                one.y == two.y &&
-                one.width == two.width &&
-                one.height == two.height);
-    },
-
     _computeAllWindowSlots: function(windows) {
         let totalWindows = windows.length;
         let node = this.actor.get_theme_node();
@@ -1569,18 +1552,8 @@ const Workspace = new Lang.Class({
             height: this._height - padding.top - padding.bottom,
         };
 
-        if (!this._currentLayout)
-            this._currentLayout = this._computeLayout(windows, area, rowSpacing, columnSpacing);
-
-        let layout = this._currentLayout;
-        let strategy = layout.strategy;
-
-        if (!this._rectEqual(area, layout.area)) {
-            layout.area = area;
-            strategy.computeScaleAndSpace(layout);
-        }
-
-        return strategy.computeWindowSlots(layout, area);
+        let layout = this._computeLayout(windows, area, rowSpacing, columnSpacing);
+        return layout.strategy.computeWindowSlots(layout, area);
     },
 
     _onCloneSelected : function (clone, time) {


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