]> git.sur5r.net Git - i3/i3/commitdiff
Log X11 errors in i3bar. 2005/head
authorIngo Bürk <ingo.buerk@tngtech.com>
Fri, 16 Oct 2015 19:18:23 +0000 (21:18 +0200)
committerIngo Bürk <ingo.buerk@tngtech.com>
Fri, 16 Oct 2015 19:18:23 +0000 (21:18 +0200)
This commit introduces X11 error logging similar to the way we already do in i3.

fixes #1998

i3bar/src/xcb.c

index efef73650b6fb87b159f4a6a0144053b65c2ab92..63b9863af83aa2114197834d61d9aee84f4eac1e 100644 (file)
@@ -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) {