diff options
author | Robert Bragg <robert@linux.intel.com> | 2013-05-03 00:57:28 +0100 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2013-08-08 14:55:30 +0100 |
commit | 49f88c5d02ee93f0569223e50cc92a7bd6eed127 (patch) | |
tree | 9829c5a3ba60d92866fa5a55b3aa6d8af1b871d0 | |
parent | 6af4539bc0c26b86a4c5fd0500bd8868c30cba5d (diff) | |
download | mutter-49f88c5d02ee93f0569223e50cc92a7bd6eed127.tar.gz |
Adds a --nested option
This adds a --nested option to request that mutter no longer run as a
classic X compositor with an output window mapped on the X Composite
Overlay Window and also not assume it is running directly under X.
The intention is that in this mode Mutter will itself launch a headless
X server and display output will be handled by Clutter and Cogl. This
will enable running Mutter nested as an application within an X session.
This patch introduces an internal meta_is_wayland_compositor() function
as a means to condition the way mutter operates when running as a
traditional X compositor vs running as a wayland compositor where the
compositor and display server are combined into a single process.
Later we also expect to add a --kms option as another way of enabling
this wayland compositor mode that will assume full control of the
display hardware instead of running as a nested application.
-rw-r--r-- | src/core/mutter.c | 9 | ||||
-rw-r--r-- | src/core/util.c | 13 | ||||
-rw-r--r-- | src/meta/util.h | 2 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/core/mutter.c b/src/core/mutter.c index 3216726cf..439fccad3 100644 --- a/src/core/mutter.c +++ b/src/core/mutter.c @@ -46,9 +46,16 @@ print_version (const gchar *option_name, } static gchar *plugin = "default"; +static gboolean opt_nested = FALSE; GOptionEntry mutter_options[] = { { + "nested", 0, 0, G_OPTION_ARG_NONE, + &opt_nested, + N_("Run nested as an application for testing"), + NULL, + }, + { "version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, print_version, N_("Print version"), @@ -77,6 +84,8 @@ main (int argc, char **argv) exit (1); } + meta_set_is_wayland_compositor (opt_nested); + if (plugin) meta_plugin_manager_load (plugin); diff --git a/src/core/util.c b/src/core/util.c index 92a33e453..c14fad736 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -55,6 +55,7 @@ static gint verbose_topics = 0; static gboolean is_debugging = FALSE; static gboolean replace_current = FALSE; static int no_prefix = 0; +static gboolean is_wayland_compositor = FALSE; #ifdef WITH_VERBOSE_MODE static FILE* logfile = NULL; @@ -194,6 +195,18 @@ meta_set_replace_current_wm (gboolean setting) replace_current = setting; } +gboolean +meta_is_wayland_compositor (void) +{ + return is_wayland_compositor; +} + +void +meta_set_is_wayland_compositor (gboolean value) +{ + is_wayland_compositor = value; +} + char * meta_g_utf8_strndup (const gchar *src, gsize n) diff --git a/src/meta/util.h b/src/meta/util.h index be87190b0..91f968ba0 100644 --- a/src/meta/util.h +++ b/src/meta/util.h @@ -37,6 +37,8 @@ void meta_set_debugging (gboolean setting); gboolean meta_is_syncing (void); void meta_set_syncing (gboolean setting); void meta_set_replace_current_wm (gboolean setting); +gboolean meta_is_wayland_compositor (void); +void meta_set_is_wayland_compositor (gboolean setting); void meta_debug_spew_real (const char *format, ...) G_GNUC_PRINTF (1, 2); |