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
This commit is contained in:
Florian Müllner 2014-04-25 01:56:31 +02:00
parent df08ae7996
commit 05ddece9a0

View File

@ -903,7 +903,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();