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

@ -66,6 +66,8 @@ static void x11_kill_cb(pa_x11_wrapper *w, void *userdata) {
pa_assert(u);
pa_assert(u->x11_wrapper == w);
pa_log_debug("X11 client kill callback called");
if (u->x11_client) {
pa_x11_client_free(u->x11_client);
u->x11_client = NULL;