From 19a16f3ce7bd83158b2789572b685a56f8efbb49 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ingo=20B=C3=BCrk?= Date: Fri, 16 Oct 2015 21:18:23 +0200 Subject: [PATCH] Log X11 errors in i3bar. This commit introduces X11 error logging similar to the way we already do in i3. fixes #1998 --- i3bar/src/xcb.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/i3bar/src/xcb.c b/i3bar/src/xcb.c index efef7365..63b9863a 100644 --- a/i3bar/src/xcb.c +++ b/i3bar/src/xcb.c @@ -987,6 +987,13 @@ void xcb_chk_cb(struct ev_loop *loop, ev_check *watcher, int revents) { } while ((event = xcb_poll_for_event(xcb_connection)) != NULL) { + if (event->response_type == 0) { + xcb_generic_error_t *error = (xcb_generic_error_t *)event; + DLOG("Received X11 error, sequence 0x%x, error_code = %d\n", error->sequence, error->error_code); + free(event); + continue; + } + int type = (event->response_type & ~0x80); if (type == xkb_base && xkb_base > -1) { -- 2.39.5