[mutter] workspace: Downgrade assert to warning when adding window
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] workspace: Downgrade assert to warning when adding window
- Date: Fri, 29 Jan 2021 17:37:04 +0000 (UTC)
commit b55b26661f748791fd7207bf5c43b332e8da094c
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Jan 28 18:59:22 2021 +0100
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1692>
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 62328ad31a..002ee8e566 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]