diff --git a/config.h.meson b/config.h.meson index b7ca736df..4939d2a73 100644 --- a/config.h.meson +++ b/config.h.meson @@ -91,3 +91,6 @@ /* List of executable names to ignore when terminating Xwayland */ #mesondefine XWAYLAND_IGNORE_EXECUTABLES + +/* Whether the Xwayland -terminate supports a delay */ +#mesondefine HAVE_XWAYLAND_TERMINATE_DELAY diff --git a/meson.build b/meson.build index 4334b8e6a..8f615bd66 100644 --- a/meson.build +++ b/meson.build @@ -28,7 +28,7 @@ json_glib_req = '>= 0.12.0' upower_glib_req = '>= 0.99.0' xcomposite_req = '>= 0.4' xkbcommon_req = '>= 0.4.3' -xfixes_req = '>= 3' +xfixes_req = '>= 6' xi_req = '>= 1.7.4' xrandr_req = '>= 1.5.0' libstartup_notification_req = '>= 0.7' @@ -457,6 +457,7 @@ endif have_xwayland_initfd = false have_xwayland_listenfd = false +have_xwayland_terminate_delay = false if have_wayland xwayland_dep = dependency('xwayland', required: false) @@ -509,6 +510,15 @@ if have_wayland if (have_xwayland_listenfd) cdata.set('HAVE_XWAYLAND_LISTENFD', 1) endif + + # For Xwayland -listenfd usage + if xwayland_dep.found() + have_xwayland_terminate_delay = xwayland_dep.get_pkgconfig_variable('have_terminate_delay') == 'true' + endif + + if (have_xwayland_terminate_delay) + cdata.set('HAVE_XWAYLAND_TERMINATE_DELAY', 1) + endif endif have_xsetioerrorexithandler = false @@ -593,6 +603,7 @@ summary('Profiler', have_profiler, section: 'Options') summary('Xwayland initfd', have_xwayland_initfd, section: 'Options') summary('Xwayland listenfd', have_xwayland_listenfd, section: 'Options') summary('Safe X11 I/O errors', have_xsetioerrorexithandler, section: 'Options') +summary('Xwayland terminate delay', have_xwayland_terminate_delay, section: 'Options') summary('Enabled', have_tests, section: 'Tests') summary('Core tests', have_core_tests, section: 'Tests') diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 77fb366ea..5613f386d 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -40,6 +40,7 @@ #endif #include #include +#include #include #include @@ -1305,6 +1306,8 @@ meta_xwayland_setup_xdisplay (MetaXWaylandManager *manager, XSetIOErrorExitHandler (xdisplay, x_io_error_exit, manager); #endif + XFixesSetClientDisconnectMode (xdisplay, XFixesClientDisconnectFlagTerminate); + add_local_user_to_xhost (xdisplay); }