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

@ -591,6 +591,13 @@ void con_move_to_workspace(Con *con, Con *workspace) {
if (source_output != dest_output &&
workspace_is_visible(workspace)) {
workspace_show(workspace->name);
/* Unset warp_to if target con is floating. Otherwise, set warp_to to
* current target container. */
if (con->type == CT_FLOATING_CON)
x_set_warp_to(NULL);
else
x_set_warp_to(&(con->rect));
}
DLOG("Re-attaching container to %p / %s\n", next, next->name);