[mutter/wip/wayland-work: 15/25] wayland: don't require Clutter backend variables to be set from outside
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland-work: 15/25] wayland: don't require Clutter backend variables to be set from outside
- Date: Thu, 5 Sep 2013 08:42:26 +0000 (UTC)
commit e0f12b717c4b0edac41e413ca60d2a6c72534ed7
Author: Giovanni Campagna <gcampagn redhat com>
Date: Wed Aug 21 11:43:36 2013 +0200
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
src/core/main.c | 11 +++++++++++
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 2d605e6..0d60537 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 ad9e96a..5259025 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));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]