# HG changeset patch # User kcr # Date 1521492653 25200 # Mon Mar 19 13:50:53 2018 -0700 # Node ID b6c94db32169fa48058629980e73888f1b7551d6 # Parent dfe920ff71639c62d94eeba4927d62edc2ec50c1 8198654: Switch FX's default GTK version to 3 Reviewed-by: diff --git a/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java b/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java --- a/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java +++ b/modules/javafx.graphics/src/main/java/com/sun/glass/ui/gtk/GtkApplication.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,7 +146,7 @@ final int gtkVersion = forcedGtkVersion == 0 ? AccessController.doPrivileged((PrivilegedAction) () -> { - String v = System.getProperty("jdk.gtk.version","2"); + String v = System.getProperty("jdk.gtk.version","3"); int ret = 0; if ("3".equals(v) || v.startsWith("3.")) { ret = 3; diff --git a/modules/javafx.graphics/src/main/native-glass/gtk/launcher.c b/modules/javafx.graphics/src/main/native-glass/gtk/launcher.c --- a/modules/javafx.graphics/src/main/native-glass/gtk/launcher.c +++ b/modules/javafx.graphics/src/main/native-glass/gtk/launcher.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -129,7 +129,7 @@ } int success = 1; - char *** use_chain = two_to_three; + char *** use_chain = three_to_two; int i, found = 0; //at first try to detect already loaded GTK version @@ -141,17 +141,17 @@ } if (!found) { - if (wantVersion == 0 || wantVersion == 2) { + if (wantVersion == 0 || wantVersion == 3) { + use_chain = three_to_two; + } else if (wantVersion == 2) { use_chain = two_to_three; - } else if (wantVersion == 3) { - use_chain = three_to_two; } else { // Note, this should never happen, java should be protecting us if (gtk_versionDebug) { - printf("bad GTK version specified, assuming 2\n"); + printf("bad GTK version specified, assuming 3\n"); } - wantVersion = 2; - use_chain = two_to_three; + wantVersion = 3; + use_chain = three_to_two; } for (i = 0; use_chain[i] && !found; i++) {