RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v6]
Alisen Chung
achung at openjdk.org
Tue Jan 28 23:11:47 UTC 2025
On Fri, 24 Jan 2025 18:51:04 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:
>> Alisen Chung has updated the pull request incrementally with one additional commit since the last revision:
>>
>> init finX, finY
>
> src/java.desktop/share/classes/java/awt/Robot.java line 253:
>
>> 251: leastXDiff = currXDiff;
>> 252: leastYDiff = currYDiff;
>> 253: }
>
> Both branches must be executed at the same time — you have adjust both <var>x</var> and <var>y</var> if the diff isn't 0.
>
> Probably, min/max would work better here too.
I changed the algorithm to keep track of the closest screen in the x direction and the closest screen in the y direction, then at the end choose the closer screen between x and y distances
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22781#discussion_r1932987627
More information about the client-libs-dev
mailing list