From 0dab133fe578b3b12241ce6f01b58bc755088da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 30 Sep 2013 19:55:26 +0200 Subject: [PATCH] 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 --- js/ui/windowManager.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 75be4c53b..31b7d2dfe 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -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; },