ignore MotionNotify events generated while warping the pointer

This commit is contained in:
Michael Stapelberg
2012-12-27 17:04:13 +01:00
parent 9edbcc4790
commit d8e27dd5aa
3 changed files with 15 additions and 11 deletions

View File

@ -920,8 +920,12 @@ void x_push_changes(Con *con) {
Output *current = get_output_containing(pointerreply->root_x, pointerreply->root_y);
Output *target = get_output_containing(mid_x, mid_y);
if (current != target)
if (current != target) {
/* Ignore MotionNotify events generated by warping */
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT });
xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, mid_x, mid_y);
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ ROOT_EVENT_MASK });
}
}
warp_to = NULL;
}