[mutter] workspace: Correctly initialize MRU list



commit 4f3de2ce399830ab9690d524d88d71008a4b342b
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Sep 29 23:02:02 2014 +0200

    workspace: Correctly initialize MRU list
    
    The workspace MRU lists are updated when windows are managed/unmanaged
    or change workspaces. However those updates obviously only apply to
    existing workspaces - new workspaces will always start out with an empty
    MRU list, despite sticky windows already being "on" that workspace.
    As we now assert that the list contains all windows located on the
    workspace, we need to initialize it correctly to avoid a crash.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=737581

 src/core/workspace.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/core/workspace.c b/src/core/workspace.c
index 2248f70..e9e7563 100644
--- a/src/core/workspace.c
+++ b/src/core/workspace.c
@@ -170,6 +170,7 @@ MetaWorkspace*
 meta_workspace_new (MetaScreen *screen)
 {
   MetaWorkspace *workspace;
+  GSList *windows, *l;
 
   workspace = g_object_new (META_TYPE_WORKSPACE, NULL);
 
@@ -179,6 +180,13 @@ 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]