mutter/config.h.meson
Olivier Fourdan e5347af000 xwayland: Check X11 clients prior to terminate Xwayland
Currently, mutter checks for the presence of X11 windows to decide
whether or not Xwayland can be terminated, when Xwayland is started on
demand.

Unfortunately, not all X11 clients will map a window all the time, an
X11 client may keep the X11 connection opened after closing all its
windows. In that case, we may terminate Xwayland while there are some
X11 client connected still, and terminating Xwayland will also kill
those X11 clients.

To avoid that issue, check the X11 clients actually connected using the
XRes extension. The XRes extension provides the PID of the (local) X11
clients connected to the Xserver, so we need to match that against the
actual executable names, and compare with a list of known executables
that we can safely ignore, such as ibus-x11 or gsd-xsettings.

We also check against our own executable name, considering that the X11
window manager is also an X11 client connected to the Xserver.

Also, XRes returning the PID of local clients only is not a problem
considering that Xwayland does not listen to remote connections.
However, if the user spawns a client remotely on another system using
ssh tunneling (ssh -X), only clients which actually map a window will
be accounted for.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1537
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1671>
2021-01-18 17:52:22 +01:00

88 lines
2.1 KiB
Plaintext

/* The prefix for our gettext translation domains. */
#mesondefine GETTEXT_PACKAGE
/* Version number of package */
#mesondefine VERSION
/* Version number of package */
#mesondefine PACKAGE_VERSION
/* Search path for plugins */
#mesondefine MUTTER_PLUGIN_DIR
/* */
#mesondefine MUTTER_LOCALEDIR
/* */
#mesondefine MUTTER_LIBEXECDIR
/* */
#mesondefine MUTTER_PKGDATADIR
/* Defined if EGL support is enabled */
#mesondefine HAVE_EGL
/* Defined if EGLDevice support is enabled */
#mesondefine HAVE_EGL_DEVICE
/* Defined if EGLStream support is enabled */
#mesondefine HAVE_WAYLAND_EGLSTREAM
/* Building with gudev for device type detection */
#mesondefine HAVE_LIBGUDEV
/* Building with libwacom for advanced tablet management */
#mesondefine HAVE_LIBWACOM
/* Define if you want to enable the native (KMS) backend based on systemd */
#mesondefine HAVE_NATIVE_BACKEND
/* Define if you want to enable Wayland support */
#mesondefine HAVE_WAYLAND
/* Defined if screen cast and remote desktop support is enabled */
#mesondefine HAVE_REMOTE_DESKTOP
/* Building with SM support */
#mesondefine HAVE_SM
/* Building with startup notification support */
#mesondefine HAVE_STARTUP_NOTIFICATION
/* Building with Sysprof profiling support */
#mesondefine HAVE_PROFILER
/* Path to Xwayland executable */
#mesondefine XWAYLAND_PATH
/* Xwayland applications allowed to issue keyboard grabs */
#mesondefine XWAYLAND_GRAB_DEFAULT_ACCESS_RULES
/* XKB base prefix */
#mesondefine XKB_BASE
/* Whether <sys/prctl.h> exists and it defines prctl() */
#mesondefine HAVE_SYS_PRCTL
/* Either <sys/random.h> or <linux/random.h> */
#mesondefine HAVE_SYS_RANDOM
#mesondefine HAVE_LINUX_RANDOM
/* Whether Xwayland has -initfd option */
#mesondefine HAVE_XWAYLAND_INITFD
/* Whether libX11 has XSetIOErrorExitHandler */
#mesondefine HAVE_XSETIOERROREXITHANDLER
/* Whether the mkostemp function exists */
#mesondefine HAVE_MKOSTEMP
/* Whether the posix_fallocate function exists */
#mesondefine HAVE_POSIX_FALLOCATE
/* Whether the memfd_create function exists */
#mesondefine HAVE_MEMFD_CREATE
/* List of executable names to ignore when terminating Xwayland */
#mesondefine XWAYLAND_IGNORE_EXECUTABLES