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

@ -414,8 +414,10 @@ static bool _tree_next(Con *con, char way, orientation_t orientation, bool wrap)
workspace_show(workspace->name);
Con *focus = con_descend_direction(workspace, direction);
if (focus)
if (focus) {
con_focus(focus);
x_set_warp_to(&(focus->rect));
}
return true;
}