add error check and log for xcb_create_window
This commit is contained in:
parent
3e3528cc15
commit
9bc504ebdb
25
src/xcb.c
25
src/xcb.c
|
@ -28,16 +28,21 @@ xcb_window_t create_window(xcb_connection_t *conn, Rect dims,
|
||||||
visual = XCB_COPY_FROM_PARENT;
|
visual = XCB_COPY_FROM_PARENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
xcb_create_window(conn,
|
xcb_void_cookie_t gc_cookie = xcb_create_window(conn,
|
||||||
depth,
|
depth,
|
||||||
result, /* the window id */
|
result, /* the window id */
|
||||||
root, /* parent == root */
|
root, /* parent == root */
|
||||||
dims.x, dims.y, dims.width, dims.height, /* dimensions */
|
dims.x, dims.y, dims.width, dims.height, /* dimensions */
|
||||||
0, /* border = 0, we draw our own */
|
0, /* border = 0, we draw our own */
|
||||||
window_class,
|
window_class,
|
||||||
visual,
|
visual,
|
||||||
mask,
|
mask,
|
||||||
values);
|
values);
|
||||||
|
|
||||||
|
xcb_generic_error_t *error = xcb_request_check(conn, gc_cookie);
|
||||||
|
if (error != NULL) {
|
||||||
|
ELOG("Could not create window. Error code: %d.\n", error->error_code);
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the cursor */
|
/* Set the cursor */
|
||||||
if (xcursor_supported) {
|
if (xcursor_supported) {
|
||||||
|
|
Loading…
Reference in New Issue