On Fri, 5 May 2023 06:22:31 GMT, Maxim Kartashev <[email protected]> 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 > > 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. Updated. > 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"? Yes, this sounds much better, updated. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1186212568 PR Review Comment: https://git.openjdk.org/jdk/pull/13809#discussion_r1186212219
