From d07e2f409089ac08e6f7f0eeae978ee681c80354 Mon Sep 17 00:00:00 2001 From: Tom Beckmann Date: Sun, 12 Oct 2014 11:18:58 +0200 Subject: [PATCH] workspace: fix crash when creating a new workspace with sticky windows that have struts The constructor would collect windows that are sticky before initializing its state which would lead to a crash in the case of windows with struts which trigger a work area recalculation where mutter would assume, due to uninitialized state, that an existing work area has to be freed. https://bugzilla.gnome.org/show_bug.cgi?id=738384 --- src/core/workspace.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/workspace.c b/src/core/workspace.c index 4e6224e01..f275c00d9 100644 --- a/src/core/workspace.c +++ b/src/core/workspace.c @@ -180,13 +180,6 @@ meta_workspace_new (MetaScreen *screen) workspace->windows = NULL; workspace->mru_list = NULL; - /* make sure sticky windows are in our mru_list */ - windows = meta_display_list_windows (screen->display, META_LIST_SORTED); - for (l = windows; l; l = l->next) - if (meta_window_located_on_workspace (l->data, workspace)) - meta_workspace_add_window (workspace, l->data); - g_slist_free (windows); - workspace->work_areas_invalid = TRUE; workspace->work_area_monitor = NULL; workspace->work_area_screen.x = 0; @@ -205,6 +198,13 @@ meta_workspace_new (MetaScreen *screen) workspace->showing_desktop = FALSE; + /* make sure sticky windows are in our mru_list */ + windows = meta_display_list_windows (screen->display, META_LIST_SORTED); + for (l = windows; l; l = l->next) + if (meta_window_located_on_workspace (l->data, workspace)) + meta_workspace_add_window (workspace, l->data); + g_slist_free (windows); + return workspace; }