windowManager: Activate new workspace before removing the current one

When removing the current workspace, the active workspace is changed
to the preceding one automatically before we change explicitly to the
last workspace. There is no good reason to change workspaces twice in
this case, we can avoid the first one just by changing to the new
workspace before removing any workspaces.

https://bugzilla.gnome.org/show_bug.cgi?id=709064
This commit is contained in:
Florian Müllner 2013-09-30 19:55:26 +02:00
parent 4a9ffb5e2f
commit 0dab133fe5

View File

@ -254,6 +254,8 @@ const WorkspaceTracker = new Lang.Class({
if (removingCurrentWorkspace) {
// "Merge" the empty workspace we are removing with the one at the end
this._wm.blockAnimations();
global.screen.get_workspace_by_index(global.screen.n_workspaces - 1).activate(global.get_current_time());
this._wm.unblockAnimations();
}
// Delete other empty workspaces; do it from the end to avoid index changes
@ -262,11 +264,6 @@ const WorkspaceTracker = new Lang.Class({
global.screen.remove_workspace(this._workspaces[i], global.get_current_time());
}
if (removingCurrentWorkspace) {
global.screen.get_workspace_by_index(global.screen.n_workspaces - 1).activate(global.get_current_time());
this._wm.unblockAnimations();
}
this._checkWorkspacesId = 0;
return false;
},