screen: Tweak workspace initialization (again)

Commit 8100cefd4c 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
This commit is contained in:
Florian Müllner 2014-07-10 17:24:32 +02:00
parent 4e2092d593
commit 06a31992e3
2 changed files with 4 additions and 2 deletions

View File

@ -848,9 +848,10 @@ meta_display_open (void)
the_display->screen = screen; the_display->screen = screen;
meta_screen_init_workspaces (screen);
enable_compositor (the_display); enable_compositor (the_display);
meta_screen_init_workspaces (screen);
meta_screen_create_guard_window (screen); meta_screen_create_guard_window (screen);
/* Set up touch support */ /* Set up touch support */

View File

@ -786,7 +786,6 @@ meta_screen_init_workspaces (MetaScreen *screen)
else else
meta_verbose ("No _NET_CURRENT_DESKTOP present\n"); meta_verbose ("No _NET_CURRENT_DESKTOP present\n");
meta_workspace_activate (screen->workspaces->data, timestamp);
update_num_workspaces (screen, timestamp); update_num_workspaces (screen, timestamp);
set_workspace_names (screen); set_workspace_names (screen);
@ -797,6 +796,8 @@ meta_screen_init_workspaces (MetaScreen *screen)
if (current_workspace != NULL) if (current_workspace != NULL)
meta_workspace_activate (current_workspace, timestamp); meta_workspace_activate (current_workspace, timestamp);
else
meta_workspace_activate (screen->workspaces->data, timestamp);
} }
void void