[mutter/wip/wayland-display: 14/65] MetaWayland: install an X io error handler
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland-display: 14/65] MetaWayland: install an X io error handler
- Date: Wed, 14 Aug 2013 16:44:42 +0000 (UTC)
commit 5f4121830cbfe5df13075edc2ec715ef48433245
Author: Giovanni Campagna <gcampagn redhat com>
Date: Mon Aug 12 15:31:18 2013 +0200
MetaWayland: install an X io error handler
This way can detect X disconnections correctly, crash with a core
dump and reset the tty.
src/wayland/meta-xwayland.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c
index d78b199..f306bb2 100644
--- a/src/wayland/meta-xwayland.c
+++ b/src/wayland/meta-xwayland.c
@@ -301,6 +301,14 @@ xserver_died (GPid pid,
}
}
+static int
+x_io_error (Display *display)
+{
+ g_error ("Connection to xwayland lost");
+
+ return 0;
+}
+
gboolean
meta_xwayland_start (MetaWaylandCompositor *compositor)
{
@@ -422,6 +430,13 @@ meta_xwayland_start (MetaWaylandCompositor *compositor)
g_main_loop_run (compositor->init_loop);
+ /* We install an X IO error handler in addition to the child watch,
+ because after Xlib connects our child watch may not be called soon
+ enough, and therefore we won't crash when X exits (and most important
+ we won't reset the tty).
+ */
+ XSetIOErrorHandler (x_io_error);
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]