We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 65f32d2 commit be515b5Copy full SHA for be515b5
src/WorkspaceManager.vala
@@ -262,8 +262,18 @@ public class Gala.WorkspaceManager : Object {
262
private void cleanup () {
263
unowned Meta.WorkspaceManager manager = wm.get_display ().get_workspace_manager ();
264
265
- foreach (var workspace in manager.get_workspaces ()) {
266
- maybe_remove_workspace (workspace, null);
+ bool remove_last = false;
+ 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);
276
277
}
278
279
0 commit comments