Only warp pointer once during x_push_changes()

- Introduce warp_to static variable in x.c that stores the coordinates
  to warp to as a Rect.

- Add x_set_warp_to function to set this variable.  Use in _tree_next,
  workspace_show, and con_move_to_workspace.

- In x_push_chanages, if warp_to is set, then call xcb_warp_pointer_rect
  and then reset it to NULL.

This fixes all know bugs for pointer warping for me.
This commit is contained in:
Peter Bui
2011-08-11 21:54:59 -04:00
committed by Michael Stapelberg
parent 637d2a3d62
commit 36224f86d1
6 changed files with 41 additions and 5 deletions

View File

@ -104,4 +104,11 @@ void x_set_name(Con *con, const char *name);
*/
void x_set_i3_atoms();
/**
* Set warp_to coordinates. This will trigger on the next call to
* x_push_changes().
*
*/
void x_set_warp_to(Rect *rect);
#endif