x11: gracefully handle X11 connection error

Perform X11 connection recovery via XSetIOErrorExitHandler mechanism.

Implementation is largely inspired by this change to GNOME/mutter
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1447

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/441>
This commit is contained in:
Igor V. Kovalenko 2020-12-22 20:54:40 +03:00 committed by PulseAudio Marge Bot
parent 28f646fd87
commit b6396dbe9c
8 changed files with 81 additions and 6 deletions

View file

@ -64,7 +64,7 @@ static void die_cb(SmcConn connection, SmPointer client_data) {
pa_log_debug("Got die message from XSMP.");
pa_x11_wrapper_kill(u->x11);
pa_x11_wrapper_kill_deferred(u->x11);
pa_x11_wrapper_unref(u->x11);
u->x11 = NULL;