RFR: 8307779: Relax the java.awt.Robot specification
Kevin Rushforth
kcr at openjdk.org
Wed May 10 13:09:17 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
I left a few comments inline.
src/java.desktop/share/classes/java/awt/Robot.java line 231:
> 229: * @implNote the mouse pointer may not visually move on Linux systems
> 230: * using Wayland, while the subsequent mousePress and mouseRelease
> 231: * can be delivered to the correct location
Since Wayland is an example, maybe say something more like this?
"...may not visually move on some platforms, such as Linux systems using Wayland..."
src/java.desktop/share/classes/java/awt/Robot.java line 431:
> 429: * to capture screen content, and the required permissions are not granted,
> 430: * then a {@code SecurityException} may be thrown,
> 431: * or the content of the returned {@code Color} is undefined.
Given that a `SecurityException` is only thrown on some platforms, is it worth throwing at all? Undefined colors can still occur, so I'm not sure I see much value in an exception. What do you envision that an application would do with the exception?
-------------
PR Review: https://git.openjdk.org/jdk/pull/13809#pullrequestreview-1420578775
PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1189868745
PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1189875492
More information about the client-libs-dev
mailing list