[gnome-settings-daemon] xsettings: Add support for XFixes ClientDisconnectMode
- From: Benjamin Berg <bberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] xsettings: Add support for XFixes ClientDisconnectMode
- Date: Mon, 26 Jul 2021 15:50:38 +0000 (UTC)
commit e10a1cc5e76b9ef48e3de88b9562c39e444ea8c4
Author: Olivier Fourdan <ofourdan redhat com>
Date: Fri Mar 19 17:49:45 2021 +0100
xsettings: Add support for XFixes ClientDisconnectMode
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 such as gsd-xsettings running continuously.
Those always-running clients will prevent the Xserver from terminating,
because the actual number of X11 clients will never drop to 0.
Use XFixes ClientDisconnectMode to inform the X11 server that it can
terminate even if gsd-xsettings is still running.
That will allow Xwayland to terminate automatically once regular clients
have quit.
On plain Xorg servers, the lifetime of the session is usually tied to
the session manager or window manager, and this change will have no
effect.
meson.build | 1 +
plugins/xsettings/meson.build | 1 +
plugins/xsettings/xsettings-manager.c | 3 +++
plugins/xsettings/xsettings-manager.h | 1 +
4 files changed, 6 insertions(+)
---
diff --git a/meson.build b/meson.build
index ba2a90ca..239ce871 100644
--- a/meson.build
+++ b/meson.build
@@ -106,6 +106,7 @@ pango_dep = dependency('pango', version: '>= 1.20.0')
polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.114')
upower_glib_dep = dependency('upower-glib', version: '>= 0.99.8')
x11_dep = dependency('x11')
+xfixes_dep = dependency('xfixes', version: '>= 6.0')
enable_systemd = get_option('systemd')
if enable_systemd
diff --git a/plugins/xsettings/meson.build b/plugins/xsettings/meson.build
index 9adb102c..49ed70f1 100644
--- a/plugins/xsettings/meson.build
+++ b/plugins/xsettings/meson.build
@@ -14,6 +14,7 @@ sources = gsd_xsettings_gtk + fc_monitor + wm_button_layout_translation + files(
deps = plugins_deps + [
gtk_dep,
x11_dep,
+ xfixes_dep,
libcommon_dep,
gsettings_desktop_dep,
dependency('fontconfig')
diff --git a/plugins/xsettings/xsettings-manager.c b/plugins/xsettings/xsettings-manager.c
index 947cc9ee..a154ede2 100644
--- a/plugins/xsettings/xsettings-manager.c
+++ b/plugins/xsettings/xsettings-manager.c
@@ -131,6 +131,9 @@ xsettings_manager_new (Display *display,
char buffer[256];
+
+ XFixesSetClientDisconnectMode (display, XFixesClientDisconnectFlagTerminate);
+
manager = g_slice_new (XSettingsManager);
manager->display = display;
diff --git a/plugins/xsettings/xsettings-manager.h b/plugins/xsettings/xsettings-manager.h
index a8cf151b..6346b095 100644
--- a/plugins/xsettings/xsettings-manager.h
+++ b/plugins/xsettings/xsettings-manager.h
@@ -24,6 +24,7 @@
#define XSETTINGS_MANAGER_H
#include <X11/Xlib.h>
+#include <X11/extensions/Xfixes.h>
#include "xsettings-common.h"
typedef struct _XSettingsManager XSettingsManager;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]