diff --git a/src/core/main.c b/src/core/main.c index db1805ea6..e68f3c9ed 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -201,6 +201,7 @@ static gboolean opt_sync; static gboolean opt_wayland; static gboolean opt_nested; static gboolean opt_no_x11; +static char *opt_wayland_display; #endif #ifdef HAVE_NATIVE_BACKEND static gboolean opt_display_server; @@ -262,6 +263,12 @@ static GOptionEntry meta_options[] = { N_("Run wayland compositor without starting Xwayland"), NULL }, + { + "wayland-display", 0, 0, G_OPTION_ARG_STRING, + &opt_wayland_display, + N_("Specify Wayland display name to use"), + NULL + }, #endif #ifdef HAVE_NATIVE_BACKEND { @@ -608,7 +615,14 @@ meta_init (void) #ifdef HAVE_WAYLAND if (compositor_type == META_COMPOSITOR_TYPE_WAYLAND) - meta_set_is_wayland_compositor (TRUE); + { + meta_set_is_wayland_compositor (TRUE); + if (opt_wayland_display) + { + meta_wayland_override_display_name (opt_wayland_display); + g_free (opt_wayland_display); + } + } #endif if (g_get_home_dir ()) diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c index 8d346cbd7..fe52a03e3 100644 --- a/src/wayland/meta-wayland.c +++ b/src/wayland/meta-wayland.c @@ -487,6 +487,8 @@ meta_wayland_compositor_setup (MetaWaylandCompositor *compositor) compositor->display_name = g_strdup (display_name); } + g_message ("Using Wayland display name '%s'", compositor->display_name); + if (meta_get_x11_display_policy () != META_DISPLAY_POLICY_DISABLED) { set_gnome_env ("GNOME_SETUP_DISPLAY", compositor->xwayland_manager.private_connection.name);