[gnome-shell] Workspace: ignore actual geometry changes while unmapped



commit 7d7b92419f35532e5fb48553511b0b6a2531b087
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu May 8 19:16:10 2014 +0200

    Workspace: ignore actual geometry changes while unmapped
    
    If unmapped, ignore geometry changes. This avoids doing useless
    layout work on invisible workspaces during the slider control
    animations.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729823

 js/ui/workspace.js |   24 +++++++++++++++++++++---
 1 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 464c3c2..adad46f 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -1140,6 +1140,11 @@ const Workspace = new Lang.Class({
 
         this._positionWindowsFlags = 0;
         this._positionWindowsId = 0;
+
+        this.actor.connect('notify::mapped', Lang.bind(this, function() {
+            if (this.actor.mapped)
+                this._syncActualGeometry();
+        }));
     },
 
     setFullGeometry: function(geom) {
@@ -1147,7 +1152,9 @@ const Workspace = new Lang.Class({
             return;
 
         this._fullGeometry = geom;
-        this._recalculateWindowPositions(WindowPositionFlags.NONE);
+
+        if (this.actor.mapped)
+            this._recalculateWindowPositions(WindowPositionFlags.NONE);
     },
 
     setActualGeometry: function(geom) {
@@ -1155,18 +1162,29 @@ const Workspace = new Lang.Class({
             return;
 
         this._actualGeometry = geom;
+        this._actualGeometryDirty = true;
+
+        if (this.actor.mapped)
+            this._syncActualGeometry();
+    },
 
-        if (this._actualGeometryLater)
+    _syncActualGeometry: function() {
+        if (this._actualGeometryLater || !this._actualGeometryDirty)
+            return;
+        if (!this._actualGeometry)
             return;
 
         this._actualGeometryLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
+            this._actualGeometryLater = 0;
+            if (!this.actor.mapped)
+                return false;
+
             let geom = this._actualGeometry;
 
             this._dropRect.set_position(geom.x, geom.y);
             this._dropRect.set_size(geom.width, geom.height);
             this._updateWindowPositions(Main.overview.animationInProgress ? WindowPositionFlags.ANIMATE : 
WindowPositionFlags.NONE);
 
-            this._actualGeometryLater = 0;
             return false;
         }));
     },


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