RFR: 8345538: Robot.mouseMove doesn't clamp bounds on macOS when trying to move mouse off screen [v13]
Phil Race
prr at openjdk.org
Thu May 22 21:11:54 UTC 2025
On Tue, 13 May 2025 03:42:27 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> > Moreover, it looks like as part of the "unification" the fix dropped clamping code in Robot (!)
> > https://cr.openjdk.org/%7Epchelko/9/8035568/webrev.02/src/macosx/native/sun/awt/CRobot.m.udiff.html
>
> That code executed only if the current mouse position is unknown or outside of the mainscreen, that native code was moved to the java level into the CRobot class by the patch: https://cr.openjdk.org/~pchelko/9/8035568/webrev.02/src/macosx/classes/sun/lwawt/macosx/CRobot.java.sdiff.html
ah, that's the code that executes only once, first time when robot doesn't yet "know" where it believes the pointer is.
interesting that it clamps in this case. But it isn't multi-display capable.
The native reproducer shows the same behaviour as the JDK.
We can send it to Apple but the code in this PR should be pushed
-------------
PR Comment: https://git.openjdk.org/jdk/pull/22781#issuecomment-2902578649
More information about the client-libs-dev
mailing list