DLOG("PUSHING CHANGES\n");
x_push_node(con);
+ if (warp_to) {
+ xcb_query_pointer_reply_t *pointerreply = xcb_query_pointer_reply(conn, pointercookie, NULL);
+ if (!pointerreply) {
+ ELOG("Could not query pointer position, not warping pointer\n");
+ } else {
+ int mid_x = warp_to->x + (warp_to->width / 2);
+ int mid_y = warp_to->y + (warp_to->height / 2);
+
+ Output *current = get_output_containing(pointerreply->root_x, pointerreply->root_y);
+ Output *target = get_output_containing(mid_x, mid_y);
+ if (current != target)
+ xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, mid_x, mid_y);
+ }
+ warp_to = NULL;
+ }
+
//DLOG("Re-enabling EnterNotify\n");
values[0] = FRAME_EVENT_MASK;
CIRCLEQ_FOREACH_REVERSE(state, &state_head, state) {
focused_id = root;
}
- if (warp_to) {
- xcb_query_pointer_reply_t *pointerreply = xcb_query_pointer_reply(conn, pointercookie, NULL);
- if (!pointerreply) {
- ELOG("Could not query pointer position, not warping pointer\n");
- } else {
- int mid_x = warp_to->x + (warp_to->width / 2);
- int mid_y = warp_to->y + (warp_to->height / 2);
-
- Output *current = get_output_containing(pointerreply->root_x, pointerreply->root_y);
- Output *target = get_output_containing(mid_x, mid_y);
- if (current != target)
- xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, mid_x, mid_y);
- }
- warp_to = NULL;
- }
-
xcb_flush(conn);
DLOG("ENDING CHANGES\n");