JDK-8149804 : [hidpi] FX and robot should be harmonized when using scale
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 8,9,10
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2016-02-15
  • Updated: 2017-11-03
  • Resolved: 2017-11-03
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 10
10Resolved
Related Reports
Relates :  
Relates :  
Description
Please compile/run the attached 'Test.java' on non-hidpi display. it works as expected - two clicks on the button.

Then please set -Dsun.java2d.uiScale=2 - the app. size didn't changed (is it what expected?), but robot is obviously missing the button (the same for HiDPI monitor).

getLocation() returns the same location, but in case of scaling the robot interprets it differently.

OS: Win. 7 and 8, JDK9 b104 and b105 nightly used for PIT

the same behavior for com.sun.glass.ui.Robot
Comments
In addition to specify -Dsun.java2d.uiScale=2, we also need to specify -Dglass.win.uiScale=2 to make sure FX and awt Robot is synchronized, otherwise awt will be scaled but not FX or vice versa. With the above, the test behaves like non-scaled version.
03-11-2017

Targeted to 10 as an issue introduced in 8u or 9
17-02-2017

a separate bug was created for the glass robot as it affects the testing process: JDK-8166382
20-09-2016

Approved by component triage team to defer
06-07-2016

SQE: jdk9: OK to defer. Note however that this argumentation in general is not very convincing: with broken robot we'll have an impact on users -- just delayed and less expected.
06-07-2016

Defer request: the current issue with using a robot in applications which mixes FX and Java code affects only tests and does not have an impact on users applications.
29-06-2016

Compiling SwingNodeJButtonTest.java with JDK 9 build 112 gives the error: ---------------------------- SwingNodeJButtonTest.java:3: error: package com.sun.glass.ui does not exist import com.sun.glass.ui.Robot; ^ SwingNodeJButtonTest.java:103: error: package com.sun.glass.ui does not exist com.sun.glass.ui.Application.invokeAndWait(run); ^ SwingNodeJButtonTest.java:107: error: package com.sun.glass.ui does not exist return com.sun.glass.ui.Application.GetApplication().createRobot(); ^ 3 errors ----------------------------
06-04-2016

it seems the issue with com.sun.glass.ui occured starting from b111 (after jigsaw integration) Please use "-XaddExports:javafx.graphics/com.sun.glass.ui=ALL-UNNAMED" when compiling/running Or use 'Test.java' to reproduce - it uses awt Robot
06-04-2016

if this is JavaFX issue -- please re-assign to javafx/swing category/subcategory (AlexZ)
15-02-2016

not sure if javafx or client-libs is more appropriate component here
15-02-2016