mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
MetaWayland: install an X io error handler
This way can detect X disconnections correctly, crash with a core dump and reset the tty.
This commit is contained in:
parent
43d499318f
commit
5f4121830c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user