jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.29k stars 321 forks source link

Fix bug where `sync` would wait if the mouse didn't need to move. #464

Closed jordansissel closed 5 months ago

jordansissel commented 5 months ago

A case where xdotool mousemove --sync is used, and the cursor is already at the requested position, xdotool would wait even though the cursor was already at the current position.

This happened because mousemove --sync waits for the cursor to move away from its current position, but if mousemove is given the position where the cursor already is, then --sync will cause it incorrectly to wait.

Reproducing this:

xdotool mousemove --sync 5 5     # works
xdotool mousemove --sync 5 5     # hangs until I move the mouse manually

Reported by @MXarko

Fixes #463