JDK-8309621 : [XWayland][Screencast] screen capture failure with sun.java2d.uiScale other than 1
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 21,22
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2023-06-07
  • Updated: 2024-08-06
  • Resolved: 2023-10-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 17 JDK 21 JDK 22
11.0.26-oracleFixed 17.0.13-oracleFixed 21.0.5-oracleFixed 22 b20Fixed
Related Reports
Relates :  
Description
java -Dsun.java2d.uiScale=2 HiDPIRobotScreenCaptureTest.java
java -Dsun.java2d.uiScale=3 ScreenCaptureGtkTest.java

Creating screen capture of java.awt.Rectangle[x=89,y=99,width=100,height=100]
Exception in thread "main" java.lang.SecurityException: Screen Capture in the selected area was not allowed
	at java.desktop/sun.awt.screencast.ScreencastHelper.getRGBPixels(ScreencastHelper.java:161)
	at java.desktop/sun.awt.X11.XRobotPeer.getRGBPixels(XRobotPeer.java:139)
	at java.desktop/java.awt.Robot.createCompatibleImage(Robot.java:606)
	at java.desktop/java.awt.Robot.createScreenCapture(Robot.java:477)
	at ScreenCaptureGtkTest.captureImageOf(ScreenCaptureGtkTest.java:130)
	at ScreenCaptureGtkTest.main(ScreenCaptureGtkTest.java:96)

https://github.com/openjdk/jdk/pull/13803#issuecomment-1564568586
Comments
jdk17u-dev backport request I would like to have the patch in jdk17u-dev as well, for parity with OracleJDK. The backport is clean except one test that is missing in jdk17u-dev and low risk.
19-07-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk17u-dev/pull/2725 Date: 2024-07-18 13:11:57 +0000
18-07-2024

[jdk21u-fix-request] Approval Request from Martin Should get backported for parity with 21.0.25-oracle. Applies cleanly and tier 1-4 have passed (included headful test also).
20-06-2024

A pull request was submitted for review. URL: https://git.openjdk.org/jdk21u-dev/pull/762 Date: 2024-06-19 12:00:25 +0000
19-06-2024

Changeset: 387896fb Author: Alexander Zvegintsev <azvegint@openjdk.org> Date: 2023-10-11 22:14:23 +0000 URL: https://git.openjdk.org/jdk/commit/387896fb349f341081c6075fb7169e9f3a0919cd
11-10-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16027 Date: 2023-10-03 10:30:50 +0000
03-10-2023