RFR: 8326712: Robot tests fail on XWayland [v2]

Alexander Zvegintsev azvegint at openjdk.org
Fri Jun 28 18:12:37 UTC 2024


On Fri, 28 Jun 2024 13:20:57 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>>> If the SecurityException is not thrown, how does the caller of getRGBPixels knows that the result will not be correct because of the missing permission? (as opposed to being incorrect due to a failure)
>> 
>> He won't know it. An indirect result of failure can be a black image.
>> The [current documentation](https://github.com/openjdk/jfx/blob/master/modules/javafx.graphics/src/main/java/javafx/scene/robot/Robot.java#L240) documentation specifies only IllegalStateException and NullPointerException.
>
> Since `SecurityException` is deprecated, we should not throw that.
> 
> In a similar situation on macOS (user has not enabled screen capture), we return a blank (all black) image, so I think that's what we would do here.

Updated to return a blank image if permission is not granted.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1490#discussion_r1659136275


More information about the openjfx-dev mailing list