/* TODO: utf8? */
char *label;
asprintf(&label, "%.*s", client->name_len, client->name);
- xcb_void_cookie_t text_cookie = xcb_image_text_8_checked(conn, strlen(label), drawable,
- gc, 3 /* X */, offset + font->height /* Y = baseline of font */, label);
- check_error(conn, text_cookie, "Could not draw client's title");
+ xcb_image_text_8(conn, strlen(label), drawable, gc, 3 /* X */, offset + font->height /* Y = baseline of font */, label);
free(label);
}
snprintf(label, sizeof(label), "%d", c+1);
xcb_change_gc_single(conn, screen->bargc, XCB_GC_FOREGROUND, text_color[set]);
xcb_change_gc_single(conn, screen->bargc, XCB_GC_BACKGROUND, background_color[set]);
- xcb_void_cookie_t text_cookie = xcb_image_text_8_checked(conn, strlen(label), screen->bar,
- screen->bargc, drawn * height + 5 /* X */,
+ xcb_image_text_8(conn, strlen(label), screen->bar, screen->bargc, drawn * height + 5 /* X */,
font->height + 1 /* Y = baseline of font */, label);
- check_error(conn, text_cookie, "Could not draw workspace title");
drawn++;
}
}
xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
xcb_window_t result = xcb_generate_id(conn);
xcb_cursor_t cursor_id = xcb_generate_id(conn);
- xcb_void_cookie_t cookie;
/* If the window class is XCB_WINDOW_CLASS_INPUT_ONLY, depth has to be 0 */
uint16_t depth = (window_class == XCB_WINDOW_CLASS_INPUT_ONLY ? 0 : XCB_COPY_FROM_PARENT);
0, 0, 0, 65535, 65535, 65535);
}
- cookie = xcb_create_window_checked(conn,
- depth,
- result, /* the window id */
- root, /* parent == root */
- dims.x, dims.y, dims.width, dims.height, /* dimensions */
- 0, /* border = 0, we draw our own */
- window_class,
- XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
- mask,
- values);
- check_error(conn, cookie, "Could not create window");
-
- if (cursor > -1) {
- cookie = xcb_change_window_attributes_checked(conn, result, XCB_CW_CURSOR, &cursor_id);
- check_error(conn, cookie, "Could not change window attributes");
- }
+ xcb_create_window(conn,
+ depth,
+ result, /* the window id */
+ root, /* parent == root */
+ dims.x, dims.y, dims.width, dims.height, /* dimensions */
+ 0, /* border = 0, we draw our own */
+ window_class,
+ XCB_WINDOW_CLASS_COPY_FROM_PARENT, /* copy visual from parent */
+ mask,
+ values);
+
+ if (cursor > -1)
+ xcb_change_window_attributes(conn, result, XCB_CW_CURSOR, &cursor_id);
/* Map the window (= make it visible) */
xcb_map_window(conn, result);