Skip to content

Instantly share code, notes, and snippets.

@Tireg
Created November 8, 2019 14:24
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/cd97aa57df65706adb12b2f6210f580e to your computer and use it in GitHub Desktop.
Save Tireg/cd97aa57df65706adb12b2f6210f580e to your computer and use it in GitHub Desktop.
Fix gala's multitasking view with mutter 3.3x
diff --git a/src/Widgets/MultitaskingView.vala b/src/Widgets/MultitaskingView.vala
index cede706..ef997df 100644
--- a/src/Widgets/MultitaskingView.vala
+++ b/src/Widgets/MultitaskingView.vala
@@ -389,29 +389,20 @@ namespace Gala
// FIXME is there a better way to get the removed workspace?
#if HAS_MUTTER330
unowned Meta.WorkspaceManager manager = display.get_workspace_manager ();
+ unowned List<Workspace> existing_workspaces = null;
+ for (int i = 0; i < manager.get_n_workspaces (); i++) {
+ existing_workspaces.append (manager.get_workspace_by_index (i));
+ }
#else
unowned List<Meta.Workspace> existing_workspaces = screen.get_workspaces ();
#endif
foreach (var child in workspaces.get_children ()) {
unowned WorkspaceClone clone = (WorkspaceClone) child;
-#if HAS_MUTTER330
- for (int i = 0; i < manager.get_n_workspaces (); i++) {
- if (manager.get_workspace_by_index (i) == clone.workspace) {
- workspace = clone;
- break;
- }
- }
-
- if (workspace != null) {
- break;
- }
-#else
if (existing_workspaces.index (clone.workspace) < 0) {
workspace = clone;
break;
}
-#endif
}
if (workspace == null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment