< prev index next >

src/java.desktop/unix/classes/sun/awt/X11GraphicsDevice.java

Print this page

        

*** 279,289 **** ArrayList<DisplayMode> modes); private static native void configDisplayMode(int screen, int width, int height, int displayMode); private static native void resetNativeData(int screen); ! private static native int getNativeScaleFactor(int screen); /** * Returns true only if: * - the Xrandr extension is present * - the necessary Xrandr functions were loaded successfully --- 279,289 ---- ArrayList<DisplayMode> modes); private static native void configDisplayMode(int screen, int width, int height, int displayMode); private static native void resetNativeData(int screen); ! private static native double getNativeScaleFactor(int screen); /** * Returns true only if: * - the Xrandr extension is present * - the necessary Xrandr functions were loaded successfully
*** 514,534 **** public int getScaleFactor() { return scale; } private int initScaleFactor() { if (SunGraphicsEnvironment.isUIScaleEnabled()) { double debugScale = SunGraphicsEnvironment.getDebugScale(); if (debugScale >= 1) { return (int) debugScale; } ! ! int nativeScale = getNativeScaleFactor(screen); return nativeScale >= 1 ? nativeScale : 1; } return 1; } --- 514,538 ---- public int getScaleFactor() { return scale; } + public int getNativeScale() { + isXrandrExtensionSupported(); + return (int)Math.round(getNativeScaleFactor(screen)); + } + private int initScaleFactor() { if (SunGraphicsEnvironment.isUIScaleEnabled()) { double debugScale = SunGraphicsEnvironment.getDebugScale(); if (debugScale >= 1) { return (int) debugScale; } ! int nativeScale = getNativeScale(); return nativeScale >= 1 ? nativeScale : 1; } return 1; }
< prev index next >