[gnome-shell/gnome-3-12] workspaceThumbnails: Fix removal of multiple workspaces



commit 4720bc34124a1ee8b7cd16a3dc635be9de3537b0
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Apr 25 01:56:31 2014 +0200

    workspaceThumbnails: Fix removal of multiple workspaces
    
    When workspaces have been removed, we need to remove the corresponding
    thumbnails as well; the number of thumbnails that need removing is
    the difference between the old number of workspaces and the new one.
    Currently we assume that the old number of workspaces corresponds to
    the number of existing thumbnails, but that may actually be wrong:
    A thumbnail will still be animated out after its workspace has been
    removed. As a result, we end up removing too many thumbnails when a
    workspace is removed while a thumbnail of a previously removed workspace
    is still animating out. Fix this by basing the old number of workspaces
    only on thumbnails that have not been removed previously.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728820

 js/ui/workspaceThumbnail.js |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index 25469e3..9a70219 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -902,7 +902,10 @@ const ThumbnailsBox = new Lang.Class({
     },
 
     _workspacesChanged: function() {
-        let oldNumWorkspaces = this._thumbnails.length;
+        let validThumbnails = this._thumbnails.filter(function(t) {
+            return t.state <= ThumbnailState.NORMAL;
+        });
+        let oldNumWorkspaces = validThumbnails.length;
         let newNumWorkspaces = global.screen.n_workspaces;
         let active = global.screen.get_active_workspace_index();
 


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