Blame SOURCES/0001-workspace-Downgrade-assert-to-warning-when-adding-wi.patch

93ca48
From d33a244603d1dd63e2e25255af98f489c65645f6 Mon Sep 17 00:00:00 2001
93ca48
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
93ca48
Date: Mon, 29 Aug 2022 16:01:48 +0200
93ca48
Subject: [PATCH] workspace: Downgrade assert to warning when adding window
93ca48
93ca48
An extension can by accident cause us to end up in a state where we try
93ca48
to add the same window to a workspace twice. When this happens we
93ca48
shouldn't crash, but instead complain loudly.
93ca48
93ca48
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/992
93ca48
Related: https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/157
93ca48
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1692>
93ca48
---
93ca48
 src/core/workspace.c | 3 ++-
93ca48
 1 file changed, 2 insertions(+), 1 deletion(-)
93ca48
93ca48
diff --git a/src/core/workspace.c b/src/core/workspace.c
93ca48
index 58fcfa78c5..ed16a83098 100644
93ca48
--- a/src/core/workspace.c
93ca48
+++ b/src/core/workspace.c
93ca48
@@ -370,7 +370,8 @@ void
93ca48
 meta_workspace_add_window (MetaWorkspace *workspace,
93ca48
                            MetaWindow    *window)
93ca48
 {
93ca48
-  g_assert (g_list_find (workspace->mru_list, window) == NULL);
93ca48
+  g_return_if_fail (g_list_find (workspace->mru_list, window) == NULL);
93ca48
+
93ca48
   workspace->mru_list = g_list_prepend (workspace->mru_list, window);
93ca48
 
93ca48
   workspace->windows = g_list_prepend (workspace->windows, window);
93ca48
-- 
93ca48
2.37.1
93ca48