- false, /* get all pointer events specified by the following mask */
- root, /* grab the root window */
- XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION, /* which events to let through */
- XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
- XCB_GRAB_MODE_ASYNC, /* keyboard mode */
- confine_to, /* confine_to = in which window should the cursor stay */
- xcursor, /* possibly display a special cursor */
- XCB_CURRENT_TIME);
-
- if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL)) == NULL) {
- ELOG("Could not grab pointer\n");
+ false, /* get all pointer events specified by the following mask */
+ root, /* grab the root window */
+ XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION, /* which events to let through */
+ XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
+ XCB_GRAB_MODE_ASYNC, /* keyboard mode */
+ confine_to, /* confine_to = in which window should the cursor stay */
+ xcursor, /* possibly display a special cursor */
+ XCB_CURRENT_TIME);
+
+ if ((reply = xcb_grab_pointer_reply(conn, cookie, &error)) == NULL) {
+ ELOG("Could not grab pointer (error_code = %d)\n", error->error_code);
+ free(error);