JBR-2305 jcef: jb/java/jcef/JCEFStartupTest.java throws java.lang.ExceptionInInitializerError

(cherry picked from commit f0385f01ec)
This commit is contained in:
Anton Tarasov
2020-04-18 16:01:56 +03:00
committed by alexey.ushakov@jetbrains.com
parent 30ab20a3e1
commit d6d9106a41

View File

@@ -129,8 +129,10 @@ public abstract class JBCefApp {
settings.resources_dir_path = JCEF_PATH;
settings.locales_dir_path = JCEF_PATH + "/locales";
settings.browser_subprocess_path = JCEF_PATH + "/jcef_helper";
double scale = sysScale();
System.setProperty("jcef.forceDeviceScaleFactor", Double.toString(scale));
return new String[] {
"--force-device-scale-factor=" + sysScale()
"--force-device-scale-factor=" + scale
};
}
}
@@ -152,7 +154,7 @@ public abstract class JBCefApp {
public static double sysScale() {
try {
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX();
return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform().getScaleX();
} catch (NullPointerException ignore) {}
return 1.0;
}