Print libxcb error codes for broken connections

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2013-11-16 11:28:27 +01:00
parent 80aa6b1922
commit 6a669a8775
1 changed files with 3 additions and 2 deletions

View File

@ -207,7 +207,8 @@ a_xcb_io_cb(GIOChannel *source, GIOCondition cond, gpointer data)
/* a_xcb_check() already handled all events */ /* a_xcb_check() already handled all events */
if(xcb_connection_has_error(globalconf.connection)) if(xcb_connection_has_error(globalconf.connection))
fatal("X server connection broke"); fatal("X server connection broke (error %d)",
xcb_connection_has_error(globalconf.connection));
return TRUE; return TRUE;
} }
@ -381,7 +382,7 @@ main(int argc, char **argv)
/* X stuff */ /* X stuff */
globalconf.connection = xcb_connect(NULL, &globalconf.default_screen); globalconf.connection = xcb_connect(NULL, &globalconf.default_screen);
if(xcb_connection_has_error(globalconf.connection)) if(xcb_connection_has_error(globalconf.connection))
fatal("cannot open display"); fatal("cannot open display (error %d)", xcb_connection_has_error(globalconf.connection));
globalconf.screen = xcb_aux_get_screen(globalconf.connection, globalconf.default_screen); globalconf.screen = xcb_aux_get_screen(globalconf.connection, globalconf.default_screen);
globalconf.default_visual = draw_default_visual(globalconf.screen); globalconf.default_visual = draw_default_visual(globalconf.screen);