From 06a31992e3ccb6020c49324f99f006eb53a09ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 10 Jul 2014 17:24:32 +0200 Subject: [PATCH] screen: Tweak workspace initialization (again) Commit 8100cefd4c34a fixed a crash during workspace initialization by tweaking the startup sequence; as a result, the plugin (like gnome-shell) is now started before workspaces are fully initialized, which breaks some reasonable assumptions (like always having an active workspace). This is particularly problematic considering that the code making those assumptions is not necessarily our own (extensions!), so return to fully initialize workspaces before the compositor again. At the same time, make sure to only call meta_workspace_activate() once during initialization to avoid reintroducing the crash. https://bugzilla.gnome.org/show_bug.cgi?id=732695 --- src/core/display.c | 3 ++- src/core/screen.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index f37fc3258..a4bf820fd 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -848,9 +848,10 @@ meta_display_open (void) the_display->screen = screen; + meta_screen_init_workspaces (screen); + enable_compositor (the_display); - meta_screen_init_workspaces (screen); meta_screen_create_guard_window (screen); /* Set up touch support */ diff --git a/src/core/screen.c b/src/core/screen.c index 0195a65c2..0b0dc7e9e 100644 --- a/src/core/screen.c +++ b/src/core/screen.c @@ -786,7 +786,6 @@ meta_screen_init_workspaces (MetaScreen *screen) else meta_verbose ("No _NET_CURRENT_DESKTOP present\n"); - meta_workspace_activate (screen->workspaces->data, timestamp); update_num_workspaces (screen, timestamp); set_workspace_names (screen); @@ -797,6 +796,8 @@ meta_screen_init_workspaces (MetaScreen *screen) if (current_workspace != NULL) meta_workspace_activate (current_workspace, timestamp); + else + meta_workspace_activate (screen->workspaces->data, timestamp); } void