[mutter/wip/carlosg/xwayland-non-fatal-io-errors] wayland: Set IO error exit handler
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/xwayland-non-fatal-io-errors] wayland: Set IO error exit handler
- Date: Thu, 17 Sep 2020 20:48:41 +0000 (UTC)
commit 8b643e47e8a6e7826643b58f68ceccb09d4d370b
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jun 14 16:04:44 2019 +0200
wayland: Set IO error exit handler
If this call is available, we can turn libX11 IO errors (fatal by definition)
into something we can recover from. Try to dispose all X11 resources and close
the display instead, so the compositor can survive the event.
src/wayland/meta-xwayland.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index f2d193e95e..30f05ca089 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -334,6 +334,17 @@ x_io_error (Display *display)
return 0;
}
+static void
+x_io_error_exit (void)
+{
+ MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default ();
+ MetaXWaylandManager *manager = &compositor->xwayland_manager;
+
+ g_warning ("Xwayland just died, attempting to recover");
+ manager->xserver_grace_period_id =
+ g_idle_add (shutdown_xwayland_cb, manager);
+}
+
void
meta_xwayland_override_display_number (int number)
{
@@ -795,6 +806,7 @@ meta_xwayland_complete_init (MetaDisplay *display,
we won't reset the tty).
*/
XSetIOErrorHandler (x_io_error);
+ XSetIOErrorExitHandler (x_io_error_exit);
g_signal_connect (display, "x11-display-closing",
G_CALLBACK (on_x11_display_closing), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]