mirror of
https://github.com/Raymo111/i3lock-color.git
synced 2025-02-24 16:06:26 -05:00
Die when the X11 connection breaks during runtime (Thanks Eduan)
This commit is contained in:
parent
7bb152664f
commit
7f450a52f6
1 changed files with 3 additions and 0 deletions
3
i3lock.c
3
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) {
|
static void xcb_check_cb(EV_P_ ev_check *w, int revents) {
|
||||||
xcb_generic_event_t *event;
|
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) {
|
while ((event = xcb_poll_for_event(conn)) != NULL) {
|
||||||
if (event->response_type == 0) {
|
if (event->response_type == 0) {
|
||||||
xcb_generic_error_t *error = (xcb_generic_error_t*)event;
|
xcb_generic_error_t *error = (xcb_generic_error_t*)event;
|
||||||
|
|
Loading…
Add table
Reference in a new issue