JDK-8218605 : Startup Splash Screen of SwingSet2 flashes in smaller coordinates before appearing in the final size
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8u211
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-02-07
  • Updated: 2019-08-31
  • Resolved: 2019-03-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.
8u221 b02Fixed
Related Reports
Relates :  
his was tested on Windows 10 x64 machine 
Run 2 instances of SwingSet2 application with sun.java2d.dpiaware set to true /false. 
$JAVA_HOME/bin/java -jar -Dsun.java2d.dpiaware=true SwingSet2.jar & 
$JAVA_HOME/bin/java -jar -Dsun.java2d.dpiaware=true SwingSet2.jar 

Observe and Compare the size and position of the splash screen at startup. 
With dpiaware flag set to false it opens up as expected in the screen and app center, and stays in the same position till it is disposed and replcaed by the application. 
With dpiaware flag set to true it opens up closer to the top left corner of the screen and open in a smaller size for a second and then flashes back to the center of screen in a slightly bigger size. 

I'm looking into backporting this to 8u, if applicable & possible.

You're absolutely right. I specifically mentioned this case two comments above but ignored it in my previous comment.

> The issue occurs only when our default behaviour differs from the value of the property. oh really ? I thought it could happen without that as follows - System is set to 120 DPI : ie 125% scaling. - Java process starts and has NOT called SetProcessDPIAware - - Splash displayed and Windows scales it up by 25% - we reach our existing code that decides if we want to be auto-scaled and decide no thanks, so call SetProcessDPIAware - windows now undoes its up-scale of the splash and it gets smaller Nowhere in there did you have to set a system property. to see the problem

Hmm. Potentially we can copy the code that decides whether or not to call SetProcessDPIAware into the splashscreen code so it can set it (or not) before we display the splashscreen. This is possible because it is all native code - no JVM needed. But in such a case we would not be able to read the System Property since that is Java. We'd need to add an equivalent environment variable that can be looked at by native code.

[~smandalika] what version you are running?