diff options
author | Giovanni Campagna <gcampagn@redhat.com> | 2013-08-21 11:43:36 +0200 |
---|---|---|
committer | Giovanni Campagna <gcampagn@redhat.com> | 2013-09-04 15:13:11 +0200 |
commit | f59d92a246d29971c7232a0051a2b2e4f984013a (patch) | |
tree | 0160b74275c67e3f288f033a05d5bd199f74fd50 | |
parent | b7983201d7a71615adafa21071a752b682bf0db7 (diff) | |
download | mutter-f59d92a246d29971c7232a0051a2b2e4f984013a.tar.gz |
wayland: don't require Clutter backend variables to be set from outside
When running under mutter-launch, we can assume we're running on
bare metal, and set the clutter backend appropriately.
https://bugzilla.gnome.org/show_bug.cgi?id=706421
-rw-r--r-- | src/core/main.c | 11 | ||||
-rw-r--r-- | src/wayland/meta-wayland.c | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/core/main.c b/src/core/main.c index 2d605e6d3..0d6053759 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -249,6 +249,17 @@ meta_get_option_context (void) bindtextdomain (GETTEXT_PACKAGE, MUTTER_LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); + /* We must set the variables here, because Clutter creates the backend + when the first call is made. + + We consider running from mutter-launch equivalent to running from bare metal. + */ + if (getenv ("WESTON_LAUNCHER_SOCK")) + { + g_setenv ("CLUTTER_BACKEND", "eglnative", TRUE); + g_setenv ("CLUTTER_INPUT_BACKEND", "evdev", TRUE); + } + ctx = g_option_context_new (NULL); g_option_context_add_main_entries (ctx, meta_options, GETTEXT_PACKAGE); g_option_context_add_group (ctx, clutter_get_option_group_without_init ()); diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index ad9e96ac7..5259025ba 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -883,6 +883,9 @@ meta_wayland_init (void) if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS) g_error ("Failed to initialize Clutter"); + unsetenv ("CLUTTER_BACKEND"); + unsetenv ("CLUTTER_INPUT_BACKEND"); + backend = clutter_get_default_backend (); cogl_context = clutter_backend_get_cogl_context (backend); cogl_renderer = cogl_display_get_renderer (cogl_context_get_display (cogl_context)); |