File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -262,9 +262,17 @@ public class Gala.WorkspaceManager : Object {
262262 private void cleanup () {
263263 unowned Meta . WorkspaceManager manager = wm. get_display (). get_workspace_manager ();
264264
265- foreach (var workspace in manager. get_workspaces ()) {
266- if (! workspace. active && Utils . get_n_windows (workspace, true ) == 0 && workspace. index () != manager. n_workspaces - 1 ) {
267- queue_remove_workspace (workspace);
265+ bool remove_last = false ;
266+ foreach (var workspace in manager. get_workspaces (). copy ()) {
267+ if (Utils . get_n_windows (workspace, true ) != 0 ) {
268+ remove_last = false ;
269+ continue ;
270+ }
271+
272+ if (workspace. active) {
273+ remove_last = true ;
274+ } else if (workspace. index () != manager. n_workspaces - 1 || remove_last) {
275+ remove_workspace (workspace);
268276 }
269277 }
270278 }
You can’t perform that action at this time.
0 commit comments