From: Michael Stapelberg Date: Thu, 21 Aug 2014 07:34:03 +0000 (+0200) Subject: Die when the X11 connection breaks during runtime (Thanks Eduan) X-Git-Tag: 2.7~18 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7f450a52f60ac543540a8ef50fd6d440bf0d4c8a;p=i3%2Fi3lock Die when the X11 connection breaks during runtime (Thanks Eduan) --- diff --git a/i3lock.c b/i3lock.c index b1be828..b2dbd6b 100644 --- a/i3lock.c +++ b/i3lock.c @@ -534,6 +534,9 @@ static void xcb_prepare_cb(EV_P_ ev_prepare *w, int revents) { static void xcb_check_cb(EV_P_ ev_check *w, int revents) { xcb_generic_event_t *event; + if (xcb_connection_has_error(conn)) + errx(EXIT_FAILURE, "X11 connection broke, did your server terminate?\n"); + while ((event = xcb_poll_for_event(conn)) != NULL) { if (event->response_type == 0) { xcb_generic_error_t *error = (xcb_generic_error_t*)event;