diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2020-10-20 21:38:05 +0200 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2020-10-20 21:16:30 +0000 |
commit | cd52288ddcfd922510cc952437c777221816dc55 (patch) | |
tree | 91badf1f9e8137fc1608ebb1984bd36843eebaf7 | |
parent | de610a13f1ad1e7e34d4b9a81df58d4da3693059 (diff) | |
download | mutter-cd52288ddcfd922510cc952437c777221816dc55.tar.gz |
wayland: Allow specifying Wayland display name from command line
Useful to avoid warnings when starting when there is already an active
Wayland compositor in the session.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1515
-rw-r--r-- | src/core/main.c | 16 | ||||
-rw-r--r-- | src/wayland/meta-wayland.c | 2 |
2 files changed, 17 insertions, 1 deletions
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); |