int dx, dy;
Cursor cursor;
unsigned int shape; /* cursor style */
+ xcb_grab_pointer_reply_t *gpr;
xcb_query_pointer_reply_t *xpr;
if (win == NULL)
cursor = XCreateFontCursor(display, shape);
- if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync,
- GrabModeAsync, None, cursor, CurrentTime) != GrabSuccess) {
+ gpr = xcb_grab_pointer_reply(conn,
+ xcb_grab_pointer(conn, False, win->id, MOUSEMASK,
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC, XCB_WINDOW_NONE,
+ cursor, XCB_CURRENT_TIME),
+ NULL);
+ if (!gpr) {
XFreeCursor(display, cursor);
free(xpr);
return;
Time time = 0;
int move_step = 0;
struct swm_region *r = NULL;
-
+ xcb_grab_pointer_reply_t *gpr;
xcb_query_pointer_reply_t *qpr;
if (win == NULL)
return;
}
- if (XGrabPointer(display, win->id, False, MOUSEMASK, GrabModeAsync,
- GrabModeAsync, None, XCreateFontCursor(display, XC_fleur),
- CurrentTime) != GrabSuccess)
- return;
+ gpr = xcb_grab_pointer_reply(conn,
+ xcb_grab_pointer(conn, False, win->id, MOUSEMASK,
+ XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
+ XCB_WINDOW_NONE, XCreateFontCursor(display, XC_fleur),
+ XCB_CURRENT_TIME),
+ NULL);
+ if (!gpr)
+ return;
/* get cursor offset from window root */
qpr = xcb_query_pointer_reply(conn, xcb_query_pointer(conn, win->id),