xserver-multidpi/xfixes
Olivier Fourdan e167299f60 xfixes: Add ClientDisconnectMode
With Wayland compositors now being able to start Xwayland on demand, the
next logical step is to be able to stop Xwayland when there is no more
need for it.

The Xserver itself is capable of terminating itself once all X11 clients
are gone, yet in a typical full session, there are a number of X11
clients running continuously (e.g. the Xsettings daemon, IBus, etc.).

Those always-running clients will prevent the Xserver from terminating,
because the actual number of X11 clients will never drop to 0. Worse,
the X11 window manager of a Wayland compositor also counts as an X11
client, hence also preventing Xwayland from stopping.

Some compositors such as mutter use the XRes extension to query the X11
clients connected, match their PID with the actual executable name and
compare those with a list of executables that can be ignored when
deciding to kill the Xserver.

But that's not just clumsy, it is also racy, because a new X11 client
might initiate a connection the X11 server right when the compositor is
about to kill it.

To solve this issue directly at the Xserver level, this add new entries
to the XFixes extension to let the X11 clients themselves specify the
disconnect mode they expect.

Typically, those X11 daemon clients would specify the disconnect mode
XFixesClientDisconnectFlagTerminate to let the Xserver know that they
should not be accounted for when checking the remaining clients prior
to terminate.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-06-07 17:28:05 +02:00
..
Makefile.am xfixes: Add ClientDisconnectMode 2021-06-07 17:28:05 +02:00
cursor.c Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
disconnect.c xfixes: Add ClientDisconnectMode 2021-06-07 17:28:05 +02:00
meson.build xfixes: Add ClientDisconnectMode 2021-06-07 17:28:05 +02:00
region.c xfixes: unvalidated lengths (CVE-2017-12183) 2017-10-10 23:33:44 +02:00
saveset.c xfixes: unvalidated lengths (CVE-2017-12183) 2017-10-10 23:33:44 +02:00
select.c dispatch: Mark swapped dispatch as _X_COLD 2017-03-01 10:16:20 -05:00
xfixes.c xfixes: Add ClientDisconnectMode 2021-06-07 17:28:05 +02:00
xfixes.h xfixes: Unexport xfixes.h 2015-07-08 16:40:58 -04:00
xfixesint.h xfixes: Add ClientDisconnectMode 2021-06-07 17:28:05 +02:00