Merge pull request #2005 from Airblader/feature-1998

Log X11 errors in i3bar.
This commit is contained in:
Michael Stapelberg 2015-10-16 15:21:46 -07:00
commit 22b05f0073
1 changed files with 7 additions and 0 deletions

View 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) { 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); int type = (event->response_type & ~0x80);
if (type == xkb_base && xkb_base > -1) { if (type == xkb_base && xkb_base > -1) {