JDK-8055453 : Not possible to specify a Java application as per-monitor DPI aware in Windows 8
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u65,8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_8
  • CPU: x86
  • Submitted: 2014-08-19
  • Updated: 2016-05-29
  • Resolved: 2016-05-29
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
tbd_majorResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REQUEST :
In Windows 8.1 per monitor DPI awareness / scaling was introduced (see http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx ), which currently cannot be turned off in a Java application. 

As far as I understand the system property sun.java2d.dpiaware can be used to specify a Java application as System-DPI aware. This system property only accepts true or false. I think the best solution would be to extend the system property with the options that can be also specified with the help of the Windows manifest file: False, True, Per-monitor, True/PM (see http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266(v=vs.85).aspx  )

JUSTIFICATION :
We develop a medical application and therefore rely on the correct display of our application. However, the display is wrong when the Windows per monitor scaling is active. Moreover, in our application the GUI is scaled well in our code. Thus, Windows shouldn't scale our Java/Swing application.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
A Java application can be specified as Per-monitor DPI aware.
ACTUAL -
A Java application cannot be specified as Per-monitor DPI aware.


Comments
The fix JDK-7013109 sets the dpiAware property in the src/java.base/windows/native/launcher/java.manifest and it can't be changed after that by SetProcessDPIAware method in the awt_Win32GraphicsEnv.cpp.
23-10-2015