< prev index next >

modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java

Print this page

        

*** 84,113 **** System.out.println(description+val); } return val; } ! GtkApplication() { // Check whether the Display is valid and throw an exception if not. // We use UnsupportedOperationException rather than HeadlessException // so as not to introduce a dependency on AWT. if (!isDisplayValid()) { throw new UnsupportedOperationException("Unable to open DISPLAY"); } ! int gtkVersion = AccessController.doPrivileged((PrivilegedAction<Integer>) () -> { String v = System.getProperty("jdk.gtk.version","2"); int ret = 0; if ("3".equals(v) || v.startsWith("3.")) { ret = 3; } else if ("2".equals(v) || v.startsWith("2.")) { ret = 2; } return ret; ! }); boolean gtkVersionVerbose = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> { return Boolean.getBoolean("jdk.gtk.verbose"); }); if (PrismSettings.allowHiDPIScaling) { --- 84,113 ---- System.out.println(description+val); } return val; } ! GtkApplication(int forcedGtkVersion) { // Check whether the Display is valid and throw an exception if not. // We use UnsupportedOperationException rather than HeadlessException // so as not to introduce a dependency on AWT. if (!isDisplayValid()) { throw new UnsupportedOperationException("Unable to open DISPLAY"); } ! final int gtkVersion = forcedGtkVersion == 0 ? AccessController.doPrivileged((PrivilegedAction<Integer>) () -> { String v = System.getProperty("jdk.gtk.version","2"); int ret = 0; if ("3".equals(v) || v.startsWith("3.")) { ret = 3; } else if ("2".equals(v) || v.startsWith("2.")) { ret = 2; } return ret; ! }) : forcedGtkVersion; boolean gtkVersionVerbose = AccessController.doPrivileged((PrivilegedAction<Boolean>) () -> { return Boolean.getBoolean("jdk.gtk.verbose"); }); if (PrismSettings.allowHiDPIScaling) {
< prev index next >