Skip to content

Instantly share code, notes, and snippets.

@Tireg
Created November 8, 2019 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tireg/7641308eea067e6ea28753d4bb86a430 to your computer and use it in GitHub Desktop.
Save Tireg/7641308eea067e6ea28753d4bb86a430 to your computer and use it in GitHub Desktop.
Fix last index of the gala cleanup function
diff --git a/src/WorkspaceManager.vala b/src/WorkspaceManager.vala
index e2da277..c49fe4c 100644
--- a/src/WorkspaceManager.vala
+++ b/src/WorkspaceManager.vala
@@ -389,13 +389,13 @@ namespace Gala
#if HAS_MUTTER330
unowned Meta.Display display = wm.get_display ();
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
- var last_index = manager.get_n_workspaces () - 1;
unowned List<Meta.Workspace> existing_workspaces = null;
for (int i = 0; i < manager.get_n_workspaces (); i++) {
existing_workspaces.append (manager.get_workspace_by_index (i));
}
foreach (var workspace in workspaces) {
+ var last_index = manager.get_n_workspaces () - 1;
if (Utils.get_n_windows (workspace) < 1
&& workspace.index () != last_index) {
remove_workspace (workspace);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment