RFR: 8307779: Relax the java.awt.Robot specification
Maxim Kartashev
mkartashev at openjdk.org
Tue May 9 19:54:40 UTC 2023
On Thu, 4 May 2023 16:26:47 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:
> We need to relax the java.awt.Robot specification according to the latest operating system trends.
> This should at least cover the case of Wayland, which has changed many familiar concepts in Linux.
>
> https://bugs.openjdk.org/browse/JDK-8280982 [Wayland] [XWayland] java.awt.Robot taking screenshots
> https://bugs.openjdk.org/browse/JDK-8280995 [XWayland] Robot.mouseMove does not visually move mouse cursor
> https://bugs.openjdk.org/browse/JDK-8280990 [XWayland] XTest emulated mouse click does not bring window to front.
> https://bugs.openjdk.org/browse/JDK-8280988 [XWayland] Click on title to request focus test failures
LGTM, although I am not an OpenJDK reviewer.
src/java.desktop/share/classes/java/awt/Robot.java line 407:
> 405: * <br>
> 406: * The pixel color may be black if permission to capture a particular screen
> 407: * has not been granted.
This seems to contradict with the "throws" description as it is not clear when black is returned and when SecurityException is thrown in response to the user denying screen capturing.
src/java.desktop/share/classes/java/awt/Robot.java line 633:
> 631:
> 632: /**
> 633: * Resets the stored screen data capture permission for a set of screens.
Does "reset" here mean that the next attempt to capture screen pixels will require another permission? It's not clear what the effects of this "reset" are.
Also, the part "for a set of screens" kind of implies that for some other set of screens the permission will not be reset, but how can one specify for which set of screens the permission is to be reset? Perhaps, simply
"Revokes the stored permission to capture screen data. Subsequent calls to getPixelColor and createScreenCapture may request a new permission from the user on applicable platforms"?
src/java.desktop/share/classes/java/awt/peer/RobotPeer.java line 133:
> 131: /**
> 132: * Resets the stored screen data capture permission for a set of screens.
> 133: * Is a no-op if not supported by the platform.
Same here as in `Robot.resetScreenCapturePermission()`.
-------------
Marked as reviewed by mkartashev (no project role).
PR Review: https://git.openjdk.org/jdk/pull/13809#pullrequestreview-1416293668
PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1185735125
PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1185873389
PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1185875012
More information about the client-libs-dev
mailing list