From b55b26661f748791fd7207bf5c43b332e8da094c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 28 Jan 2021 18:59:22 +0100 Subject: [PATCH] workspace: Downgrade assert to warning when adding window An extension can by accident cause us to end up in a state where we try to add the same window to a workspace twice. When this happens we shouldn't crash, but instead complain loudly. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/992 Related: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/157 Part-of: --- src/core/workspace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/workspace.c b/src/core/workspace.c index 62328ad31..002ee8e56 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -369,10 +369,11 @@ void meta_workspace_add_window (MetaWorkspace *workspace, MetaWindow *window) { + g_return_if_fail (g_list_find (workspace->mru_list, window) == NULL); + COGL_TRACE_BEGIN_SCOPED (MetaWorkspaceAddWindow, "Workspace (add window)"); - g_assert (g_list_find (workspace->mru_list, window) == NULL); workspace->mru_list = g_list_prepend (workspace->mru_list, window); workspace->windows = g_list_prepend (workspace->windows, window);