From ffbc52575f7feb8e94d28016a0a4d3dab575e2d4 Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 8 Nov 2019 18:22:22 +0100 Subject: [PATCH] Fix Multitasking-View remove_workspace callback which has an incorrect algorithm to remove destroyed workspaces --- src/Widgets/MultitaskingView.vala | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/Widgets/MultitaskingView.vala b/src/Widgets/MultitaskingView.vala index cede706ad..ef997dfa1 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 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 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)