diff --git a/data/gala.metainfo.xml.in b/data/gala.metainfo.xml.in index f3920349b..bdbabb72c 100644 --- a/data/gala.metainfo.xml.in +++ b/data/gala.metainfo.xml.in @@ -40,6 +40,9 @@ Wrong workspaces behavior Use gestures for "move to workspace" Alt + Shift unnecessarily blocked when there is only one keyboard layout + Multitasking view breaks when switching displays & strange Wingpanel position + Disconnecting external monitor breaks the multi-tasking view + Workspace wallpaper's aspect ratio with different monitors Counter Strike 2 causes segfault in libmutter on exit Scheduled switch to dark style does not dim the wallpaper after cold reboot on elementary OS 7.1 Notifications appear in the middle of the screen diff --git a/src/Widgets/MultitaskingView.vala b/src/Widgets/MultitaskingView.vala index 81f993760..42fe4f17f 100644 --- a/src/Widgets/MultitaskingView.vala +++ b/src/Widgets/MultitaskingView.vala @@ -82,11 +82,7 @@ namespace Gala { add_child (primary_monitor_container); add_child (dock_clones); - unowned Meta.WorkspaceManager manager = display.get_workspace_manager (); - for (int i = 0; i < manager.get_n_workspaces (); i++) { - add_workspace (i); - } - + unowned var manager = display.get_workspace_manager (); manager.workspace_added.connect (add_workspace); manager.workspace_removed.connect (remove_workspace); manager.workspaces_reordered.connect (() => update_positions (false)); @@ -141,6 +137,8 @@ namespace Gala { * MonitorClones at the right positions */ private void update_monitors () { + update_workspaces (); + foreach (var monitor_clone in window_containers_monitors) { monitor_clone.destroy (); } @@ -176,6 +174,19 @@ namespace Gala { } } + private void update_workspaces () { + foreach (unowned var child in workspaces.get_children ()) { + unowned var workspace_clone = (WorkspaceClone) child; + icon_groups.remove_group (workspace_clone.icon_group); + workspace_clone.destroy (); + } + + unowned var manager = display.get_workspace_manager (); + for (int i = 0; i < manager.get_n_workspaces (); i++) { + add_workspace (i); + } + } + /** * Scroll through workspaces with the mouse wheel. Smooth scrolling is handled by * GestureTracker. diff --git a/src/Widgets/WorkspaceClone.vala b/src/Widgets/WorkspaceClone.vala index 25dceb500..638d5038e 100644 --- a/src/Widgets/WorkspaceClone.vala +++ b/src/Widgets/WorkspaceClone.vala @@ -245,6 +245,8 @@ namespace Gala { listener.window_no_longer_on_all_workspaces.disconnect (add_window); background.destroy (); + window_container.destroy (); + icon_group.destroy (); } private void reallocate () {