--- old/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java 2016-11-22 19:10:35.178503276 +0300 +++ new/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java 2016-11-22 19:10:35.098503278 +0300 @@ -86,7 +86,7 @@ return val; } - GtkApplication() { + GtkApplication(int forcedGtkVersion) { // Check whether the Display is valid and throw an exception if not. // We use UnsupportedOperationException rather than HeadlessException @@ -95,17 +95,17 @@ throw new UnsupportedOperationException("Unable to open DISPLAY"); } - int gtkVersion = - AccessController.doPrivileged((PrivilegedAction) () -> { - 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; - }); + final int gtkVersion = forcedGtkVersion == 0 ? + AccessController.doPrivileged((PrivilegedAction) () -> { + 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) () -> { return Boolean.getBoolean("jdk.gtk.verbose");