<AWT Dev> [9] Review request for 8147440 HiDPI (Windows): Swing components have incorrect sizes after changing display resolution
Alexandr Scherbatiy
alexandr.scherbatiy at oracle.com
Fri Feb 5 07:52:50 UTC 2016
Hello,
Could you review the fix:
bug: https://bugs.openjdk.java.net/browse/JDK-8147440
webrev: http://cr.openjdk.java.net/~alexsch/8147440/webrev.00/
When Display DPI is changed the Windows OS rescales a native window
size but leaves a native window location the same.
Java frame size and location are calculated as
nativeWindow.location = scale * javaWindow.location
nativeWindow.size = scale * javaWindow.size
The first approach is to rescale only frame size on native level so
newNativeWindow.size = newScale * javaWindow.size
This allows to leave the nativeWindow.location unchanged but the rule
nativeWindow.location = newScale * javaWindow.location
will be broken in this case.
The proposed fix explicitly rescales javaWindow.location in
WWindowPeer so
nativeWindow.location = prevScale * prevJavaWindow.location =
newScale * newJavaWindow.location
Thanks,
Alexandr.
More information about the awt-dev
mailing list