From 57f96b28ab50ec7b1d3ce6ba6e4d36124378c1b9 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 29 Sep 2020 13:38:40 -0300 Subject: [PATCH] workspacesView: Make sure to destroy non-existing workspaces Even if they're in the end of the list. So far we've managed to not be affected by this bug because until GNOME 3.38, workspaces didn't have a background, and there was no way to navigate to these leftover workspaces, but with the proposed overview changes for GNOME 40 it'll be very much visible. Part-of: --- js/ui/workspacesView.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 1e8faf349..a7b3b878a 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -222,6 +222,11 @@ class WorkspacesView extends WorkspacesViewBase { } } + for (let j = this._workspaces.length - 1; j >= newNumWorkspaces; j--) { + this._workspaces[j].destroy(); + this._workspaces.splice(j, 1); + } + this._updateScrollPosition(); }