From b8870a11b8fdb066bbd2ce9b07cd3abc660e9008 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 28 Jan 2022 09:56:24 +0100 Subject: [PATCH] xwayland: Warn when autoclose-xwayland is not usable The experimental feature "autoclose-xwayland" requires a couple of prerequisites: 1. Be able to (re)start Xwayland on demand, i.e. with systemd 2. Xwayland must support the terminate delay Add a warning message if "autoclose-xwayland" was requested but any of those prerequisites is not met. Part-of: --- src/wayland/meta-xwayland.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index f2485d2bc..5d1846dfc 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -868,14 +868,25 @@ meta_xwayland_start_xserver (MetaXWaylandManager *manager, args[i++] = XWAYLAND_LISTENFD; args[i++] = "7"; #endif -#ifdef HAVE_XWAYLAND_TERMINATE_DELAY - if (x11_display_policy == META_X11_DISPLAY_POLICY_ON_DEMAND && - meta_settings_is_experimental_feature_enabled (settings, + + if (meta_settings_is_experimental_feature_enabled (settings, META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND)) +#ifdef HAVE_XWAYLAND_TERMINATE_DELAY { - /* Terminate after a 10 seconds delay */ - args[i++] = "-terminate"; - args[i++] = "10"; + if (x11_display_policy == META_X11_DISPLAY_POLICY_ON_DEMAND) + { + /* Terminate after a 10 seconds delay */ + args[i++] = "-terminate"; + args[i++] = "10"; + } + else + { + g_warning ("autoclose-xwayland disabled, requires Xwayland on demand"); + } + } +#else + { + g_warning ("autoclose-xwayland disabled, not supported"); } #endif for (j = 0; j < G_N_ELEMENTS (x11_extension_names); j++)