RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v6]

Alisen Chung achung at openjdk.org
Thu Jan 30 20:23:50 UTC 2025


On Tue, 28 Jan 2025 19:12:30 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> I would like to clarify one point: if the robot moves the mouse off the screen while the actual mouse pointer is on the screen and immediately presses the mouse button, where will the click occur? on or off the screen?

In macOS code there is similar method that checks for mouse offscreen locations called checkMousePos() which updates and clamps the mousePosition stored in CRobot and is called after mousePress and mouseRelease, but I think it makes more sense to do the clamping during the mouseMove instead of having the mouse move to nonexistent coordinates then performing operations on a clamped location based on those nonexistent coordinates.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2625496940


More information about the client-libs-dev mailing list