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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2258>
This commit is contained in:
Olivier Fourdan 2022-01-28 09:56:24 +01:00 committed by Marge Bot
parent 6ce80ccc54
commit b8870a11b8

View File

@ -868,15 +868,26 @@ meta_xwayland_start_xserver (MetaXWaylandManager *manager,
args[i++] = XWAYLAND_LISTENFD; args[i++] = XWAYLAND_LISTENFD;
args[i++] = "7"; args[i++] = "7";
#endif #endif
#ifdef HAVE_XWAYLAND_TERMINATE_DELAY
if (x11_display_policy == META_X11_DISPLAY_POLICY_ON_DEMAND && if (meta_settings_is_experimental_feature_enabled (settings,
meta_settings_is_experimental_feature_enabled (settings,
META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND)) META_EXPERIMENTAL_FEATURE_AUTOCLOSE_XWAYLAND))
#ifdef HAVE_XWAYLAND_TERMINATE_DELAY
{
if (x11_display_policy == META_X11_DISPLAY_POLICY_ON_DEMAND)
{ {
/* Terminate after a 10 seconds delay */ /* Terminate after a 10 seconds delay */
args[i++] = "-terminate"; args[i++] = "-terminate";
args[i++] = "10"; args[i++] = "10";
} }
else
{
g_warning ("autoclose-xwayland disabled, requires Xwayland on demand");
}
}
#else
{
g_warning ("autoclose-xwayland disabled, not supported");
}
#endif #endif
for (j = 0; j < G_N_ELEMENTS (x11_extension_names); j++) for (j = 0; j < G_N_ELEMENTS (x11_extension_names); j++)
{ {