JDK-8196031 : FX Robot mouseMove fails on Windows 10 1709 with HiDPI
  • Type: Bug
  • Component: javafx
  • Sub-Component: window-toolkit
  • Affected Version: 9,10,openjfx11
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-01-24
  • Updated: 2019-05-31
  • Resolved: 2018-06-12
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.
Other
openjfx11Fixed
Related Reports
Relates :  
Relates :  
Description
To reproduce, run the attached test program on a Windows 10 system with the Windows 10 1709 (the Fall Creators update) with screen scale set to 125% or greater. It will fail to move the mouse to the correct location.

To compile it, you need the following flag:

javac --add-exports javafx.graphics/com.sun.glass.ui=ALL-UNNAMED SimpleFXRobotTest.java

Before you run it, move your mouse to a corner of the screen.

Note that at least one FX Robot-based test, TabPaneDragPolicyTest, also fails in the same way.

This seems to be a bug introduced by Microsoft in Windows 10 in the mouse_move function.

I note that AWT robot also fails similarly.
Comments
As a note: if JDK-8199627 is ever backported to 8u we might need to backport this fix to 8u as well to avoid a regression.
12-06-2018

Changeset: 284d06bb1364 Author: pbansal Date: 2018-06-12 14:40 +0530 URL: http://hg.openjdk.java.net/openjfx/jfx-dev/rt/rev/284d06bb1364
12-06-2018

webrev.01 looks fine. +1
12-06-2018

The updated .01 webrev looks good to me. +1
11-06-2018

Hi Kevin & Murali, Please review the fix : http://cr.openjdk.java.net/~pbansal/8196031/webrev.00/ Issue: The FX robot mouseMove fails on Windows 10, 1709 version. Fix: The code in mouseMove is changed to use absolute mouse coordinates. The code is tested on Windows 10 with different HiDPI settings. The test passes on Linux and Mac as well. Added a system test for verification.
07-06-2018

I have attached a temporary patch for debugging that shows one possible approach to fixing the bug. It is by no means complete, or even the right solution.
24-04-2018

[~pbansal] You can probably borrow the logic from Sergey's fix for JDK-8196030 for AWT Robot (presuming that he will fix that one first).
16-02-2018

I had mistakenly added SwingNodeJDialogTest. testJDialogAbove to the list of failing tests. That one is failing sometimes for other reasons not related to this (a terminal window was obscuring the test window). So there are only the 9 failures now listed in my above comment. [update] The SwingNodeJDialogTest failure is somewhat more likely to happen on a Hi-DPI display because of this bug. A window that is near where the test Stage is displayed could mistakenly be clicked on and brought in front of the window. Still, this bug is not the fundamental reason that test fails.
14-02-2018

The following unit tests fail as a result of this bug: SceneChangeEventsTest. testSceneChange TabPaneDragPolicyTest. testFixedBottom TabPaneDragPolicyTest. testFixedLeft TabPaneDragPolicyTest. testFixedRight TabPaneDragPolicyTest. testFixedTop TabPaneDragPolicyTest. testReorderBottom TabPaneDragPolicyTest. testReorderLeft TabPaneDragPolicyTest. testReorderRight TabPaneDragPolicyTest. testReorderTop
14-02-2018

I ran the test on Windows 10 version 1703 with jdk 9_181 and jdk10_41 at HiDPi settings of 125% and 175%. I could not reproduce the issue as the attached test runs fine. I will try to access a Windows 10 1709 machine to test.
02-02-2018

This does not appear to affect JDK 8, even if we set screen scale to 150% (which is the threshold in 8u for enabling HiDPI on Windows). This may be due to the fact that we don't enable per-monitor DPI in 8u.
24-01-2018

This is not as serious as the AWT robot bug, since we do not have public API for Robot (we do use it internally for testing).
24-01-2018