JDK-8080153 : Cannot disable DPI awareness
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8,9
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-04-28
  • Updated: 2019-04-05
  • Resolved: 2019-04-05
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
tbdResolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Windows 7 x64 Professional

A DESCRIPTION OF THE PROBLEM :
When i try to add the parameter  -Dsun.java2d.dpiaware=false to a certain java process, this do nothing, because the java manifest have a configuration which is overlaying to that.

  <asmv3:application>
    <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
       <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>

Because of that i can't change the dpiaware of my process to false, using the flag dpiaware. 

I think the changes that were made to resolve the issue JDK-6829055 are responsible for this problem.

I don't have this problem in version 1.6.

REGRESSION.  Last worked in version 6u43

ADDITIONAL REGRESSION INFORMATION: 
java version "1.6.0_38"
Java(TM) SE Runtime Environment (build 1.6.0_38-b05)
Java HotSpot(TM) 64-Bit Server VM (build 20.13-b02, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
- Set Windows scaling to 200% (remove Windows XP scale mode)
- Run a graphic application which sets sun.java2d.dpiaware to false.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The application should have been scaled by windows.
ACTUAL -
The application was not automatically scaled.
I expected the interface to become blured.

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
It is possible that by changing the manifest this would work again.


Comments
Strictly it's not duplicate, provided 9 is in the Affected Versions. The bug description mentions only 8. It was impossible to make 8 dpi-unaware so that the UI is scaled to the appropriate DPI. Although it's impossible to make 9 and later dpi-unaware because dpi-awareness is declared in the manifest, these versions scale the UI to the appropriate DPI. As I understood the description, the expected result of using -Dsun.java2d.dpiaware=false was that Java app UI was scaled by Windows because the UI was too small otherwise.
05-04-2019

Careful. It might be confusing since this bug was reported against 8 ... and 9 .. and the above fix does nothing for 9 and later. So this not strictly a duplicate.
05-04-2019

JDK-8204512 makes it possible to disable and enable High DPI awareness of a Java process.
05-04-2019

The Rampdown phase start [1] milestone is approaching, it means we are not targeting "9" to fix P4s anymore, unless the fix is ready and not risky, safe enough not introduce P2-P3 regressions; if this is a case you can retarget back to "9" right before the push the reviewed code. [1] http://openjdk.java.net/projects/jdk8/milestones#Rampdown_start
29-08-2016

I believe that we need to leave the dpiAvare=true option in the manifest file for JDK 9 because JDK 9 is the DPI aware application. It reads DPI settings from the OS system and scales the whole app accordingly to it.
27-05-2016

Yes, Microsoft recommended the manifest entry for Windows 7. -Dsun.java2d.dpiaware=false is not a supported setting. We may end up removing the manifest entry for JDK 9 as it doesn't play well with per-monitor dpi-awareness in windows 8.1
12-05-2015