handle the xcb_grab_pointer reply
This commit is contained in:
parent
ffbcfa2c97
commit
6c35a0b93b
|
@ -407,16 +407,22 @@ void drag_pointer(Con *con, xcb_button_press_event_t *event, xcb_window_t
|
||||||
memcpy(&old_rect, &(con->rect), sizeof(Rect));
|
memcpy(&old_rect, &(con->rect), sizeof(Rect));
|
||||||
|
|
||||||
/* Grab the pointer */
|
/* Grab the pointer */
|
||||||
/* TODO: returncode */
|
xcb_grab_pointer_cookie_t cookie;
|
||||||
xcb_grab_pointer(conn,
|
xcb_grab_pointer_reply_t *reply;
|
||||||
false, /* get all pointer events specified by the following mask */
|
cookie = xcb_grab_pointer(conn,
|
||||||
root, /* grab the root window */
|
false, /* get all pointer events specified by the following mask */
|
||||||
XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION, /* which events to let through */
|
root, /* grab the root window */
|
||||||
XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
|
XCB_EVENT_MASK_BUTTON_RELEASE | XCB_EVENT_MASK_POINTER_MOTION, /* which events to let through */
|
||||||
XCB_GRAB_MODE_ASYNC, /* keyboard mode */
|
XCB_GRAB_MODE_ASYNC, /* pointer events should continue as normal */
|
||||||
confine_to, /* confine_to = in which window should the cursor stay */
|
XCB_GRAB_MODE_ASYNC, /* keyboard mode */
|
||||||
XCB_NONE, /* don’t display a special cursor */
|
confine_to, /* confine_to = in which window should the cursor stay */
|
||||||
XCB_CURRENT_TIME);
|
XCB_NONE, /* don’t display a special cursor */
|
||||||
|
XCB_CURRENT_TIME);
|
||||||
|
|
||||||
|
if ((reply = xcb_grab_pointer_reply(conn, cookie, NULL)) == NULL) {
|
||||||
|
ELOG("Could not grab pointer\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Go into our own event loop */
|
/* Go into our own event loop */
|
||||||
xcb_flush(conn);
|
xcb_flush(conn);
|
||||||
|
|
Loading…
Reference in New Issue