JDK-8335468 : [XWayland] JavaFX hangs when calling java.awt.Robot.getPixelColor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 21,22,23,24
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-01
  • Updated: 2025-03-25
  • Resolved: 2024-11-25
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 21 JDK 24
21.0.7-oracleFixed 24 b26Fixed
Related Reports
Blocks :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The tests/system/src/test/java/test/robot/javafx/embed/swing/SwingNodeJDialogTest.java test timeouts after implementing the ScreenCast screen capture for JavaFX(JDK-8326712), this requires a fix on OpenJDK side.

It happens due to the call to gtk->g_main_context_iteration(NULL, TRUE) when we try to capture screen data, this blocks the gtk fx main loop.


Possible solutions are:

1. make a busy wait loop if we detect a gtk loop running
gtk->g_main_context_iteration(NULL, gtk->gtk_main_level == 0);
This will prevent the SwingNodeJDialogTest from hanging, and receive pixel color successfully.

2. do the same change as in JDK-8326712, make a nested loop, this allows to get a pixel color, but the test still timed out, needs further investigation.
Comments
Fix request [21u] I backport this for parity with 21.0.7-oracle. Low to medium risk, only awt affected, but no tests. Clean backport. SAP nightly testing passes.
24-12-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk21u-dev/pull/1287 Date: 2024-12-23 15:35:36 +0000
23-12-2024

Changeset: 965aace2 Branch: master Author: Alexander Zvegintsev <azvegint@openjdk.org> Date: 2024-11-25 11:11:28 +0000 URL: https://git.openjdk.org/jdk/commit/965aace297154ab08ee41a4d988553707cae8b32
25-11-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/22131 Date: 2024-11-15 01:35:16 +0000
15-11-2024