From db4355ba1e76dc3186b2fa1e76a1277e0b8bb25d Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 17 Dec 2014 12:48:06 -0500 Subject: [PATCH] core: move backend setting to helper function This paves the way for making the backend setting be more automatic. https://bugzilla.gnome.org/show_bug.cgi?id=741666 --- src/core/main.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index 3189f84f0..ec9b58921 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -291,6 +291,21 @@ on_sigterm (gpointer user_data) return G_SOURCE_REMOVE; } +static void +init_backend (void) +{ +#if defined(CLUTTER_WINDOWING_EGL) && defined(HAVE_NATIVE_BACKEND) + if (opt_display_server) + clutter_set_windowing_backend (CLUTTER_WINDOWING_EGL); + else +#endif + clutter_set_windowing_backend (CLUTTER_WINDOWING_X11); + +#ifdef HAVE_WAYLAND + meta_set_is_wayland_compositor (opt_wayland); +#endif +} + /** * meta_init: (skip) * @@ -323,16 +338,7 @@ meta_init (void) if (g_getenv ("MUTTER_DEBUG")) meta_set_debugging (TRUE); -#if defined(CLUTTER_WINDOWING_EGL) && defined(HAVE_NATIVE_BACKEND) - if (opt_display_server) - clutter_set_windowing_backend (CLUTTER_WINDOWING_EGL); - else -#endif - clutter_set_windowing_backend (CLUTTER_WINDOWING_X11); - -#ifdef HAVE_WAYLAND - meta_set_is_wayland_compositor (opt_wayland); -#endif + init_backend (); if (g_get_home_dir ()) if (chdir (g_get_home_dir ()) < 0)