XCB_EVENT_MASK_POINTER_MOTION |
XCB_EVENT_MASK_PROPERTY_CHANGE |
XCB_EVENT_MASK_ENTER_WINDOW };
- xcb_change_window_attributes(conn, root, mask, values);
+ xcb_void_cookie_t cookie;
+ cookie = xcb_change_window_attributes_checked(conn, root, mask, values);
+ check_error(conn, cookie, "Another window manager seems to be running");
/* Setup NetWM atoms */
#define GET_ATOM(name) { \
void check_error(xcb_connection_t *conn, xcb_void_cookie_t cookie, char *err_message) {
xcb_generic_error_t *error = xcb_request_check(conn, cookie);
if (error != NULL) {
- fprintf(stderr, "ERROR: %s : %d\n", err_message , error->error_code);
+ fprintf(stderr, "ERROR: %s (X error %d)\n", err_message , error->error_code);
xcb_disconnect(conn);
exit(-1);
}