[gnome-shell] Don't add windows to overlay workspaces when overlay is being exited.



commit c018b7652f1b3c9274b430f2d8f4e784f76fb33e
Author: Marina Zhurakhinskaya <marinaz redhat com>
Date:   Tue Mar 17 18:22:25 2009 -0400

    Don't add windows to overlay workspaces when overlay is being exited.
    
    When a window is added while overlay is being exited (e.g. because
    some application was launched), we don't want to add that window to
    the workspace's window clones. Previously, the window clone was added
    and an animation to place the windows to their overlay workspace view
    positions was triggered, which resulted in the wrong animation being
    shown and an abrupt change in window positions when the actual workspace
    was shown.
    
    Add a boolean argument to two _positionWindows() calls that were missing
    an argument.
---
 js/ui/workspaces.js |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/js/ui/workspaces.js b/js/ui/workspaces.js
index 53b509a..f0eefb7 100644
--- a/js/ui/workspaces.js
+++ b/js/ui/workspaces.js
@@ -482,11 +482,14 @@ Workspace.prototype = {
         }
         clone.destroy();
 
-        this._positionWindows();
+        this._positionWindows(false);
         this.updateRemovable();
     },
 
     _windowAdded : function(metaWorkspace, metaWin) {
+        if (this.leavingOverlay) 
+            return;
+
         let win = metaWin.get_compositor_private();
 
         if (!win) {
@@ -516,7 +519,7 @@ Workspace.prototype = {
             clone.actor.set_scale (scale, scale);
         }
 
-        this._positionWindows();
+        this._positionWindows(false);
         this.updateRemovable();
     },
 
@@ -555,7 +558,9 @@ Workspace.prototype = {
                            scale_x: 1.0,
                            scale_y: 1.0,
                            time: Overlay.ANIMATION_TIME,
-                           transition: "easeOutQuad"
+                           transition: "easeOutQuad",
+                           onComplete: this._doneLeavingOverlay,
+                           onCompleteScope: this
                          });
 
         for (let i = 1; i < this._windows.length; i++) {
@@ -572,9 +577,7 @@ Workspace.prototype = {
                              });
         }
 
-        this.leavingOverlay = false;
-        this._visible = false;
-        
+        this._visible = false;        
     },
 
     // Animates grid shrinking/expanding when a row or column
@@ -650,6 +653,11 @@ Workspace.prototype = {
         this._metaWorkspace.disconnect(this._windowRemovedId);
     },
 
+    // Sets this.leavingOverlay flag to false.
+    _doneLeavingOverlay : function() {
+        this.leavingOverlay = false;
+    },
+
     // Tests if @win belongs to this workspaces
     _isMyWindow : function (win) {
         return win.get_workspace() == this.workspaceNum ||



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