Bug 1374 - Support High-DPI for JRE>8 AWT on Windows, MacOSX and Linux
Summary: Support High-DPI for JRE>8 AWT on Windows, MacOSX and Linux
Status: RESOLVED FIXED
Alias: None
Product: Jogl
Classification: JogAmp
Component: awt (show other bugs)
Version: 2.4.0
Hardware: All all
: P4 major
Assignee: Sven Gothel
URL:
Depends on:
Blocks: 1373 1404
  Show dependency treegraph
 
Reported: 2019-04-04 23:47 CEST by Sven Gothel
Modified: 2019-11-30 19:05 CET (History)
4 users (show)

See Also:
Type: DEFECT
SCM Refs:
c7858dc766cb9f76ac8f543796b1587a0f8f9279 24b75b2e91ec5f101b19fa24aa3804adb3819ebf 7ec068e0c95a230101450cc80031f76770a0cd49
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2019-04-04 23:47:25 CEST
See Bug 1373 Comment 1

+++

See AWT Java 9+ related: 'JEP 263: HiDPI Graphics on Windows and Linux' 
https://bugs.openjdk.java.net/browse/JDK-8055212

+++

OSX uses a monitor related 'float[2] pixelScale', 
which we have adopted in bug 1120 and OSX High-DPI fix in bug 741.

Our groundwork for High-DPI support indeed has been done for bug 741.

AWT on OSX should work appropriately based on fixed for bug 741 and bug 1120.

+++

AWT on Linux may use the environment variable GDK_SCALE for both dimensions.

+++

AWT on Windows may use the DPI override.
Comment 2 Sven Gothel 2019-11-30 19:05:48 CET
c7858dc766cb9f76ac8f543796b1587a0f8f9279
    Bug 1363: Java 11: Don't use GraphicsDevice.getScaleFactor() on Java9+ [illegal reflective access]
    
    Use non-reflective method to get the pixel scale on Java9+
    
    It's now possible to use GraphicsConfiguration.getDefaultTransform()
    instead of using reflection to get the pixel scale, which eliminates an
    illegal reflective access warning.
    
    Orig patch by Wade Walker

24b75b2e91ec5f101b19fa24aa3804adb3819ebf
    Bug 1363: Java 11: Use getPixelScale standard method even on Mac under Java9+
    
    Changed getPixelScale to use standard method, even on Mac
    
    Previously it used a Mac-specific method, but the new standard method of
    device.getDefaultConfiguration().getDefaultTransform() seems to work on
    Mac, so use it instead to avoid illegal reflective access warnings.
    
    Orig patch by Wade Walker.

7ec068e0c95a230101450cc80031f76770a0cd49
    Bug 1363: Java 11: Resolve unsupported JAWTUtil.getMonitorDisplayID(..)
    
    Previous commits removed access to OSX's GraphicsDevice.getCGDisplayID()
    on Java9+, avoiding illegal reflective access.
    
    Here we JAWTUtil.getMonitorDisplayID(..) simply returns null
    if Java9 or !OSX, so the sole NewtFactory caller falls back
    to the alternative working solution.
    
    Orig patch Wade Walker:
        This was used on Mac OS only to create a MonitorDevice in
        NewtFactoryAWT. But there was a fallback method for creating
        MonitorDevice, and testing with TestGearsES2GLJPanelAWT shows that the
        fallback method seems to give identical results on Mac, so changed to
        just use the fallback method (which is now the only method) everywhere.
        This gets rid of an illegal reflective access.