summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2018-02-05 15:39:21 +0800
committerJonas Ådahl <jadahl@gmail.com>2018-02-06 03:14:52 +0000
commit70fcf745b8386dc86debacbea153d0d60bfd8154 (patch)
tree2460755c332a5332cc3e93c46f75afcdbe265953
parent589e999049d00d56aafcc2fa3c1e63cee5b3182b (diff)
downloadmutter-70fcf745b8386dc86debacbea153d0d60bfd8154.tar.gz
main: Add --x11 command line argument
This is in order to force running as a X11 window manager/compositing manager. Useful for debugging and other cases where the automatic detection does not work as expected. https://gitlab.gnome.org/GNOME/mutter/merge_requests/15
-rw-r--r--src/core/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/main.c b/src/core/main.c
index dc1f1c4f6..079f6a9ef 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -181,6 +181,7 @@ static gboolean opt_nested;
#ifdef HAVE_NATIVE_BACKEND
static gboolean opt_display_server;
#endif
+static gboolean opt_x11;
static GOptionEntry meta_options[] = {
{
@@ -239,6 +240,11 @@ static GOptionEntry meta_options[] = {
N_("Run as a full display server, rather than nested")
},
#endif
+ {
+ "x11", 0, 0, G_OPTION_ARG_NONE,
+ &opt_x11,
+ N_("Run with X11 backend")
+ },
{NULL}
};
@@ -424,7 +430,13 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
GType *backend_gtype)
{
#ifdef HAVE_WAYLAND
- gboolean run_as_wayland_compositor = opt_wayland;
+ gboolean run_as_wayland_compositor = opt_wayland && !opt_x11;
+
+ if ((opt_wayland || opt_nested || opt_display_server) && opt_x11)
+ {
+ meta_warning ("Can't run both as Wayland compositor and X11 compositing manager\n");
+ meta_exit (META_EXIT_ERROR);
+ }
#ifdef HAVE_NATIVE_BACKEND
if (opt_nested && opt_display_server)
@@ -433,7 +445,7 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
meta_exit (META_EXIT_ERROR);
}
- if (!run_as_wayland_compositor)
+ if (!run_as_wayland_compositor && !opt_x11)
run_as_wayland_compositor = check_for_wayland_session_type ();
#endif /* HAVE_NATIVE_BACKEND */