RFR: 8309621: [XWayland][Screencast] screen capture failure with sun.java2d.uiScale other than 1

Harshitha Onkar honkar at openjdk.org
Tue Oct 10 16:47:09 UTC 2023


On Tue, 3 Oct 2023 10:30:50 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

> The current implementation of screen capture with ScreenCast has some shortcomings in handling ui scale.
> 
> This changeset includes:
> 
> * sun.java2d.uiScale value is now taken into account
> * screen data streams from ScreenCast are provided in native screen resolution regardless of the scale set in the system.
> Now we take that into account and resize the image accordingly.
> * We are now trying all available `restore_token`, since it is is tied to the display, but not to its resolution.
> * Skips the gtk2 part of the ScreenCaptureGtkTest as it is not supported.
> 
> Following tests are no longer failing on Wayland:
> java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java
> java/awt/Robot/HiDPIScreenCapture/ScreenCaptureGtkTest.java
> java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java
> 
> Other testing also looks good, including manual testing with various scales set in the system(including fractional scaling).

Tested by applying the patch. The listed tests pass on single-monitor and dual virtual monitor setup on Ubuntu VM 22.04. 

Minor: Copyright year needs to be updated for the test file.

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

Marked as reviewed by honkar (Committer).

PR Review: https://git.openjdk.org/jdk/pull/16027#pullrequestreview-1668281329


More information about the client-libs-dev mailing list