main: Clean up the initialization sequence

The initialization sequence before was quite icky, initializing Clutter
in a few different places depending on what was going on.

Put that all back into main.c
This commit is contained in:
Jasper St. Pierre
2014-08-18 16:54:15 -04:00
parent de69678085
commit a7b1b1da80
3 changed files with 35 additions and 24 deletions

View File

@ -348,15 +348,22 @@ meta_init (void)
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ())
{
/* NB: When running as a hybrid wayland compositor we run our own headless X
* server so the user can't control the X display to connect too. */
meta_wayland_init ();
}
else
meta_wayland_pre_clutter_init ();
#endif
/* NB: When running as a hybrid wayland compositor we run our own headless X
* server so the user can't control the X display to connect too. */
if (!meta_is_wayland_compositor ())
meta_select_display (opt_display_name);
meta_clutter_init ();
#ifdef HAVE_WAYLAND
/* Bring up Wayland. This also launches Xwayland and sets DISPLAY as well... */
if (meta_is_wayland_compositor ())
meta_wayland_init ();
#endif
meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL));
if (opt_replace_wm)
@ -367,13 +374,6 @@ meta_init (void)
meta_main_loop = g_main_loop_new (NULL, FALSE);
/* If we are running with wayland then we don't wait until we have
* an X connection before initializing clutter we instead initialize
* it earlier since we need to initialize the GL driver so the driver
* can register any needed wayland extensions. */
if (!meta_is_wayland_compositor ())
meta_clutter_init ();
meta_ui_init ();
meta_restart_init ();