Skip to content

Commit

Permalink
Merge pull request #435 from ofourdan/xdotool-use-xtest-instead-of-xw…
Browse files Browse the repository at this point in the history
…arppointer

Use XTEST instead of XWarpPointer with a single screen
  • Loading branch information
jordansissel authored Oct 16, 2024
2 parents 5689dc0 + 8478e38 commit e7a6f15
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,12 @@ int xdo_move_mouse(const xdo_t *xdo, int x, int y, int screen) {
* seem to recommend XWarpPointer instead, ie;
* https://bugzilla.redhat.com/show_bug.cgi?id=518803
*/
Window screen_root = RootWindow(xdo->xdpy, screen);
ret = XWarpPointer(xdo->xdpy, None, screen_root, 0, 0, 0, 0, x, y);
if (screen > 0) {
Window screen_root = RootWindow(xdo->xdpy, screen);
ret = XWarpPointer(xdo->xdpy, None, screen_root, 0, 0, 0, 0, x, y);
} else {
ret = XTestFakeMotionEvent(xdo->xdpy, 0, x, y, CurrentTime);
}
XFlush(xdo->xdpy);
return _is_success("XWarpPointer", ret == 0, xdo);
}
Expand Down

0 comments on commit e7a6f15

Please sign in to comment.