<AWT Dev> RFR: 8238575 DragSourceEvent.getLocation() returns wrong value on HiDPI screens (Windows)

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Feb 17 11:00:31 UTC 2020

Please review the fix for jdk/client.

Bug: https://bugs.openjdk.java.net/browse/JDK-8238575
Fix: http://cr.openjdk.java.net/~serb/8238575/webrev.00

One more place where we forgot to scale of device coordinates->user's space.

To the "awt_DnDDS.cpp" I have added a logic we already use in the "awt_DnDDT.cpp"
In all places where we post events to java, we will scale coordinates according to the
current monitor.

Two tests are updated:
  - test/jdk/java/awt/dnd/Button2DragTest/Button2DragTest.java - can be used to verify this fix
  - test/jdk/sun/awt/dnd/8024061/bug8024061.java - changed to be cross-platform, I used it during fix development

Note that Button2DragTest.java is changed in a way that exposed another HiDPI
bug, in the multimonitor configuration where the main screen is HiDPI and second
is not the test window will jump from the center of the primary monitor, but DND
will work anyway.

Best regards, Sergey.

More information about the awt-dev mailing list