diff -Nru openjdk-lts-11.0.3+4/debian/changelog openjdk-lts-11.0.3+5/debian/changelog --- openjdk-lts-11.0.3+4/debian/changelog 2019-03-21 14:07:34.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/changelog 2019-04-02 14:42:19.000000000 +0000 @@ -1,3 +1,38 @@ +openjdk-lts (11.0.3+5-1ubuntu2) disco; urgency=medium + + * Fix configuring with the vendor flags. + + -- Matthias Klose Tue, 02 Apr 2019 16:42:19 +0200 + +openjdk-lts (11.0.3+5-1ubuntu1) disco; urgency=medium + + * Sync packages with 11.0.3+5-1: + - OpenJDK 11.0.3+5 build. + - Annotate the bootstrap dependency with :native. + + -- Matthias Klose Tue, 02 Apr 2019 14:09:44 +0200 + +openjdk-lts (11.0.3+4-2ubuntu1) disco; urgency=medium + + * Sync packages with 11.0.3+4-2: + [ Matthias Klose ] + - Configure with vendor flags. + - Work around the missing gcc-for-host b-d for cross builds. + - Backport fix for 8221083, wrong oop compare in C1-generated code (PPC). + + [ Tiago Stürmer Daitx ] + - Revert to GTK2 as default since GTK3 still has padding and + component issues, apply upstream changeset to fix a few GTK3 + components: LP: #1770278. + - debian/patches/jdk-improve-gtk3-compatibility.patch: upstream + fix for JDK-8218469, JDK-8218470, JDK-8218472, and JDK-8203627. + - debian/patches/keep-gtk2-as-default.patch: revert upstream so + GTK2 is loaded before GTK3 when available. + - debian/rules, debian/control: Set jre to depend on libgtk2.0-0 + and alternatively to libgtk-3-0. + + -- Matthias Klose Thu, 28 Mar 2019 10:58:50 +0100 + openjdk-lts (11.0.3+4-1ubuntu1) disco; urgency=medium * Sync packages with 11.0.3+4-1: diff -Nru openjdk-lts-11.0.3+4/debian/control openjdk-lts-11.0.3+5/debian/control --- openjdk-lts-11.0.3+4/debian/control 2019-02-27 14:56:20.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/control 2019-04-02 12:11:56.000000000 +0000 @@ -10,11 +10,11 @@ jtreg , testng , xvfb , xauth , xfonts-base , libgl1-mesa-dri [!x32] , xfwm4 , x11-xkb-utils , dbus-x11 , autoconf, automake, autotools-dev, ant, ant-optional, - g++-8, - openjdk-11-jdk-headless | openjdk-10-jdk-headless, + g++-8 , + openjdk-11-jdk-headless:native | openjdk-10-jdk-headless:native, libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, libasound2-dev, liblcms2-dev, libfreetype6-dev (>= 2.2.1), libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libgtk-3-dev, libelf-dev, libfontconfig1-dev, libffi-dev, - zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, + zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, libnss3-dev (>= 2:3.17.1), openjdk-11-jdk-headless , Build-Depends-Indep: graphviz, pandoc, @@ -92,7 +92,6 @@ ${xandsound:Depends}, ${dlopenjre:Depends}, ${shlibs:Depends}, ${misc:Depends} Recommends: ${dlopenjre:Recommends}, ${bridge:Recommends}, fonts-dejavu-extra -Suggests: ${pkg:pulseaudio} Provides: java-runtime, java2-runtime, java5-runtime, java6-runtime, java7-runtime, java8-runtime, diff -Nru openjdk-lts-11.0.3+4/debian/control.in openjdk-lts-11.0.3+5/debian/control.in --- openjdk-lts-11.0.3+4/debian/control.in 2019-02-27 14:55:48.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/control.in 2019-04-02 12:11:53.000000000 +0000 @@ -14,7 +14,7 @@ @bd_bootstrap@ @bd_openjdk@ @bd_zero@ - @bd_syslibs@ @bd_pulsejava@ @bd_systemtap@ + @bd_syslibs@ @bd_systemtap@ @bd_nss@ @bd_cross@ Build-Depends-Indep: graphviz, pandoc, @@ -92,7 +92,6 @@ ${xandsound:Depends}, ${dlopenjre:Depends}, ${shlibs:Depends}, ${misc:Depends} Recommends: ${dlopenjre:Recommends}, ${bridge:Recommends}, @core_fonts@ -Suggests: ${pkg:pulseaudio} Provides: java-runtime, java2-runtime, java5-runtime, java6-runtime, java7-runtime, java8-runtime, diff -Nru openjdk-lts-11.0.3+4/debian/patches/8221083.diff openjdk-lts-11.0.3+5/debian/patches/8221083.diff --- openjdk-lts-11.0.3+4/debian/patches/8221083.diff 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/patches/8221083.diff 2019-03-28 10:00:21.000000000 +0000 @@ -0,0 +1,139 @@ + +# HG changeset patch +# User simonis +# Date 1553597501 -3600 +# Node ID 5487a925f70d3c32aa8bd21901135b431b639942 +# Parent 5ee30b6991a750746ed219719e9dbfbec9dff56d +8221083: [ppc64] Wrong oop compare in C1-generated code +Reviewed-by: mdoerr, goetz + +diff -r 5ee30b6991a7 -r 5487a925f70d src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp +--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp Mon Dec 03 16:25:27 2018 +0100 ++++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp Tue Mar 26 11:51:41 2019 +0100 +@@ -1455,13 +1455,11 @@ + break; + } + } else { +- if (opr2->is_address()) { +- DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment. +- LIR_Address *addr = opr2->as_address_ptr(); +- BasicType type = addr->type(); +- if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); } +- else { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); } +- __ cmpd(BOOL_RESULT, opr1->as_register(), R0); ++ assert(opr1->type() != T_ADDRESS && opr2->type() != T_ADDRESS, "currently unsupported"); ++ if (opr1->type() == T_OBJECT || opr1->type() == T_ARRAY) { ++ // There are only equal/notequal comparisons on objects. ++ assert(condition == lir_cond_equal || condition == lir_cond_notEqual, "oops"); ++ __ cmpd(BOOL_RESULT, opr1->as_register(), opr2->as_register()); + } else { + if (unsigned_comp) { + __ cmplw(BOOL_RESULT, opr1->as_register(), opr2->as_register()); +@@ -1497,14 +1495,6 @@ + } else { + ShouldNotReachHere(); + } +- } else if (opr1->is_address()) { +- DEBUG_ONLY( Unimplemented(); ) // Seems to be unused at the moment. +- LIR_Address * addr = opr1->as_address_ptr(); +- BasicType type = addr->type(); +- assert (opr2->is_constant(), "Checking"); +- if (type == T_OBJECT) { __ ld(R0, index_or_disp(addr), addr->base()->as_register()); } +- else { __ lwa(R0, index_or_disp(addr), addr->base()->as_register()); } +- __ cmpdi(BOOL_RESULT, R0, opr2->as_constant_ptr()->as_jint()); + } else { + ShouldNotReachHere(); + } +diff -r 5ee30b6991a7 -r 5487a925f70d test/hotspot/jtreg/compiler/codegen/TestOopCmp.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/test/hotspot/jtreg/compiler/codegen/TestOopCmp.java Tue Mar 26 11:51:41 2019 +0100 +@@ -0,0 +1,88 @@ ++/* ++ * Copyright (c) 2019 SAP SE. 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 ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++/** ++ * @test ++ * @bug 8221083 ++ * @requires vm.bits == 64 & vm.opt.final.UseCompressedOops == true ++ * @summary On ppc64, C1 erroneously emits a 32-bit compare instruction for oop compares. ++ * @modules java.base/jdk.internal.misc:+open ++ * @library /test/lib / ++ * @build sun.hotspot.WhiteBox ++ * @run driver ClassFileInstaller sun.hotspot.WhiteBox ++ * sun.hotspot.WhiteBox$WhiteBoxPermission ++ * @run main/othervm -Xbatch -XX:-UseTLAB -Xmx4m -XX:+UseSerialGC -XX:HeapBaseMinAddress=0x700000000 ++ * -XX:CompileCommand=compileonly,compiler.codegen.TestOopCmp::nullTest ++ * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. ++ * compiler.codegen.TestOopCmp ++ * @author volker.simonis@gmail.com ++ */ ++ ++package compiler.codegen; ++ ++import sun.hotspot.WhiteBox; ++ ++public class TestOopCmp { ++ ++ private static Object nullObj = null; ++ ++ public static boolean nullTest(Object o) { ++ if (o == nullObj) { ++ return true; ++ } else { ++ return false; ++ } ++ } ++ ++ public static void main(String args[]) { ++ ++ WhiteBox WB = WhiteBox.getWhiteBox(); ++ ++ // The test is started with -XX:HeapBaseMinAddress=0x700000000 and a ++ // small heap of only 4mb. This works pretty reliable and at least on ++ // Linux/Windows/Solaris we will get a heap starting at 0x700000000. ++ // The test also runs with -XX:+UseSerialGC which means that we'll get ++ // eden starting at 0x700000000. ++ // Calling 'System.gc()' will clean up all the objects from eden, so if ++ // eden starts at 0x700000000 the first allocation right after the ++ // system GC will be allcoated right at address 0x700000000. ++ System.gc(); ++ String s = new String("I'm not null!!!"); ++ if (WB.getObjectAddress(s) == 0x700000000L) { ++ System.out.println("Got object at address 0x700000000"); ++ } ++ ++ // We call 'nullTest()' with the newly allocated String object. If it was ++ // allocated at 0x700000000, its 32 least-significant bits will be 0 and a ++ // 32-bit comparison with 'nullObj' (which is 'null') will yield true and ++ // result in a test failure. ++ // If the code generated for 'nullTest()' correctly performs a 64-bit ++ // comparison or if we didn't manage to allcoate 's' at 0x700000000 the ++ // test will always succeed. ++ for (int i = 0; i < 30_000; i++) { ++ if (nullTest(s)) { ++ throw new RuntimeException("Comparing non-null object with null returned 'true'"); ++ } ++ } ++ } ++} + diff -Nru openjdk-lts-11.0.3+4/debian/patches/jdk-improve-gtk3-compatibility.patch openjdk-lts-11.0.3+5/debian/patches/jdk-improve-gtk3-compatibility.patch --- openjdk-lts-11.0.3+4/debian/patches/jdk-improve-gtk3-compatibility.patch 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/patches/jdk-improve-gtk3-compatibility.patch 2019-03-28 10:00:21.000000000 +0000 @@ -0,0 +1,391 @@ +Description: Upstream fix to improve GTK3 compatibility + This is an issue with gtk version 3.20 and later. GTK has made some major + changes in their theme handling in gtk 3.20 and applications need to change + to adapt to those changes. This issue is reproducible in Ubuntu 18.04 and + OEL 7.5 as the gtk version is >3.20 in both whereas in Ubuntu 16.04, the + default version is 3.18 and works fine. + + This issue solves GTK 3+ compatibility problems. Upstream patch contains + fixes for 4 issues (JDK-8218469, JDK-8218470, JDK-8218472, JDK-8203627). + It applies cleanly to 11u (and I see 11.0.4-oracle), and to 8u with + reshuffling (and I see 8u221/222). Original tests (JSlider, JProgressBar, + JScrollBar, FileChooserDemo) work fine after the patch, and looks wrong + before the patch. 8u requires -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel -Djdk.gtk.version=3 + to reproduce. The risk is low. +Origin: upstream, http://hg.openjdk.java.net/jdk/jdk/rev/76668d618a99 +Bug: https://bugs.openjdk.java.net/browse/JDK-8203627 +Bug-Ubuntu: http://launchpad.net/bugs/1770278 +Applied-Upstream: 11.0.4, http://hg.openjdk.java.net/jdk/jdk/rev/76668d618a99 +Last-Update: 2019-03-26 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ + +# HG changeset patch +# User pbansal +# Date 1550208537 -19800 +# Node ID fa3eed43d5fa27f22baae50e4c4ec9e82d0166ef +# Parent 619fc2e4250e6ce12d5e2a916ba5420c543fbe22 +8218469: JSlider display issue with slider for GTKLookAndFeel +8218470: JScrollBar display issue with GTKLookAndFeel +8218472: JProgressBar display issue with GTKLookAndFeel +8203627: Swing applications with JRadioButton and JCheckbox fail to render correctly when using GTK3 and the GTK L&F +Reviewed-by: serb, prr + +diff -r 619fc2e4250e -r fa3eed43d5fa src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java +--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri Feb 15 10:06:25 2019 -0800 ++++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri Feb 15 10:58:57 2019 +0530 +@@ -767,6 +767,14 @@ + if (classKey != null) { + Object value = getClassSpecificValue(classKey); + if (value != null) { ++ //This is a workaround as the "slider-length" property has been ++ //deprecated for GtkScale from gtk 3.20, so default value of 31 ++ //is used and makes redering of slider wrong. Value 14 is being ++ //used as default value for Slider.thumbHeight is 14 and making ++ //width 14 as well makes slider thumb render in proper shape ++ if ("Slider.thumbWidth".equals(key) && value.equals(31)) { ++ return 14; ++ } + return value; + } + } +@@ -779,8 +787,15 @@ + return getColorForState(context, ColorType.FOREGROUND); + } + else if (key == "ScrollBar.minimumThumbSize") { ++ //This is a workaround as the "min-slider-length" property has been ++ //deprecated for GtkScrollBar from gtk 3.20, so default value of 21 ++ //is used and makes ScrollBar thumb very small. Value 40 is being ++ //used as this is the value mentioned in css files + int len = + getClassSpecificIntValue(context, "min-slider-length", 21); ++ if (len == 21) { ++ len = 40; ++ } + JScrollBar sb = (JScrollBar)context.getComponent(); + if (sb.getOrientation() == JScrollBar.HORIZONTAL) { + return new DimensionUIResource(len, 0); +diff -r 619fc2e4250e -r fa3eed43d5fa src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c +--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c Fri Feb 15 10:06:25 2019 -0800 ++++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c Fri Feb 15 10:58:57 2019 +0530 +@@ -258,6 +258,7 @@ + + static gboolean gtk3_version_3_10 = TRUE; + static gboolean gtk3_version_3_14 = FALSE; ++static gboolean gtk3_version_3_20 = FALSE; + + GtkApi* gtk3_load(JNIEnv *env, const char* lib_name) + { +@@ -400,6 +401,18 @@ + } + gtk3_version_3_14 = !fp_gtk_check_version(3, 14, 0); + ++ if (!fp_gtk_check_version(3, 20, 0)) { ++ gtk3_version_3_20 = TRUE; ++ fp_gtk_widget_path_copy = dl_symbol("gtk_widget_path_copy"); ++ fp_gtk_widget_path_new = dl_symbol("gtk_widget_path_new"); ++ fp_gtk_widget_path_append_type = dl_symbol("gtk_widget_path_append_type"); ++ fp_gtk_widget_path_iter_set_object_name = dl_symbol("gtk_widget_path_iter_set_object_name"); ++ fp_gtk_style_context_set_path = dl_symbol("gtk_style_context_set_path"); ++ fp_gtk_widget_path_unref = dl_symbol("gtk_widget_path_unref"); ++ fp_gtk_style_context_get_path = dl_symbol("gtk_style_context_get_path"); ++ fp_gtk_style_context_new = dl_symbol("gtk_style_context_new"); ++ } ++ + fp_gdk_window_create_similar_surface = + dl_symbol("gdk_window_create_similar_surface"); + fp_gtk_settings_get_for_screen = +@@ -561,7 +574,6 @@ + "gtk_combo_box_new_with_entry"); + fp_gtk_separator_tool_item_new = dlsym(gtk3_libhandle, + "gtk_separator_tool_item_new"); +- + fp_g_list_append = dl_symbol("g_list_append"); + fp_g_list_free = dl_symbol("g_list_free"); + fp_g_list_free_full = dl_symbol("g_list_free_full"); +@@ -1362,6 +1374,90 @@ + return result; + } + ++static void append_element (GtkWidgetPath *path, const gchar *selector) ++{ ++ fp_gtk_widget_path_append_type (path, G_TYPE_NONE); ++ fp_gtk_widget_path_iter_set_object_name (path, -1, selector); ++} ++ ++static GtkWidgetPath* createWidgetPath(const GtkWidgetPath* path) { ++ if (path == NULL) { ++ return fp_gtk_widget_path_new(); ++ } else { ++ return fp_gtk_widget_path_copy(path); ++ } ++} ++ ++static GtkStyleContext* get_style(WidgetType widget_type, const gchar *detail) ++{ ++ if (!gtk3_version_3_20) { ++ gtk3_widget = gtk3_get_widget(widget_type); ++ GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); ++ fp_gtk_style_context_save (context); ++ if (detail != 0) { ++ transform_detail_string(detail, context); ++ } ++ return context; ++ } else { ++ gtk3_widget = gtk3_get_widget(widget_type); ++ GtkStyleContext* widget_context = fp_gtk_widget_get_style_context (gtk3_widget); ++ GtkWidgetPath *path = NULL; ++ if (detail != 0) { ++ if (strcmp(detail, "checkbutton") == 0) { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ append_element(path, "check"); ++ } else if (strcmp(detail, "radiobutton") == 0) { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ append_element(path, "radio"); ++ } else if (strcmp(detail, "vscale") == 0 || strcmp(detail, "hscale") == 0) { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ append_element(path, "slider"); ++ } else if (strcmp(detail, "trough") == 0) { ++ //This is a fast solution to the scrollbar trough not being rendered properly ++ if (widget_type == HSCROLL_BAR || widget_type == HSCROLL_BAR_TRACK || ++ widget_type == VSCROLL_BAR || widget_type == VSCROLL_BAR_TRACK) { ++ path = createWidgetPath (NULL); ++ } else { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ } ++ append_element(path, detail); ++ } else if (strcmp(detail, "bar") == 0) { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ append_element(path, "trough"); ++ append_element(path, "progress"); ++ } else if (strcmp(detail, "vscrollbar") == 0 || strcmp(detail, "hscrollbar") == 0) { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ append_element(path, "button"); ++ } else if (strcmp(detail, "check") == 0) { ++ path = createWidgetPath (NULL); ++ append_element(path, detail); ++ } else if (strcmp(detail, "option") == 0) { ++ path = createWidgetPath (NULL); ++ append_element(path, "radio"); ++ } else { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ append_element(path, detail); ++ } ++ } else { ++ path = createWidgetPath (fp_gtk_style_context_get_path (widget_context)); ++ } ++ ++ GtkStyleContext *context = fp_gtk_style_context_new (); ++ fp_gtk_style_context_set_path (context, path); ++ fp_gtk_widget_path_unref (path); ++ return context; ++ } ++} ++ ++static void disposeOrRestoreContext(GtkStyleContext *context) ++{ ++ if (!gtk3_version_3_20) { ++ fp_gtk_style_context_restore (context); ++ } else { ++ fp_g_object_unref (context); ++ } ++} ++ + static void gtk3_paint_arrow(WidgetType widget_type, GtkStateType state_type, + GtkShadowType shadow_type, const gchar *detail, + gint x, gint y, gint width, gint height, +@@ -1509,13 +1605,9 @@ + */ + gtk3_set_direction(gtk3_widget, dir); + +- GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); +- fp_gtk_style_context_save (context); +- +- transform_detail_string(detail, context); ++ GtkStyleContext* context = get_style(widget_type, detail); + + GtkStateFlags flags = get_gtk_flags(state_type); +- + if (shadow_type == GTK_SHADOW_IN && widget_type != COMBO_BOX_ARROW_BUTTON) { + flags |= GTK_STATE_FLAG_ACTIVE; + } +@@ -1532,23 +1624,31 @@ + fp_gtk_style_context_add_class (context, "default"); + } + ++ if (fp_gtk_style_context_has_class(context, "trough")) { ++ flags |= GTK_STATE_FLAG_BACKDROP; ++ } ++ + fp_gtk_style_context_set_state (context, flags); + +- if (fp_gtk_style_context_has_class(context, "progressbar")) { +- fp_gtk_render_activity (context, cr, x, y, width, height); +- } else { +- fp_gtk_render_background (context, cr, x, y, width, height); +- if (shadow_type != GTK_SHADOW_NONE) { +- fp_gtk_render_frame(context, cr, x, y, width, height); +- } ++ fp_gtk_render_background (context, cr, x, y, width, height); ++ if (shadow_type != GTK_SHADOW_NONE) { ++ fp_gtk_render_frame(context, cr, x, y, width, height); + } + +- fp_gtk_style_context_restore (context); ++ disposeOrRestoreContext(context); ++ + /* + * Reset the text direction to the default value so that we don't + * accidentally affect other operations and widgets. + */ + gtk3_set_direction(gtk3_widget, GTK_TEXT_DIR_LTR); ++ ++ //This is a fast solution to the scrollbar trough not being rendered properly ++ if ((widget_type == HSCROLL_BAR || widget_type == HSCROLL_BAR_TRACK || ++ widget_type == VSCROLL_BAR || widget_type == VSCROLL_BAR_TRACK) && detail != 0) { ++ gtk3_paint_box(widget_type, state_type, shadow_type, NULL, ++ x, y, width, height, synth_state, dir); ++ } + } + + static void gtk3_paint_box_gap(WidgetType widget_type, GtkStateType state_type, +@@ -1580,23 +1680,19 @@ + static void gtk3_paint_check(WidgetType widget_type, gint synth_state, + const gchar *detail, gint x, gint y, gint width, gint height) + { +- gtk3_widget = gtk3_get_widget(widget_type); +- +- GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); +- +- fp_gtk_style_context_save (context); ++ GtkStyleContext* context = get_style(widget_type, detail); + + GtkStateFlags flags = get_gtk_state_flags(synth_state); + if (gtk3_version_3_14 && (synth_state & SELECTED)) { +- flags = GTK_STATE_FLAG_CHECKED; ++ flags &= ~GTK_STATE_FLAG_SELECTED; ++ flags |= GTK_STATE_FLAG_CHECKED; + } + fp_gtk_style_context_set_state(context, flags); + +- fp_gtk_style_context_add_class (context, "check"); +- +- fp_gtk_render_check (context, cr, x, y, width, height); +- +- fp_gtk_style_context_restore (context); ++ fp_gtk_render_background(context, cr, x, y, width, height); ++ fp_gtk_render_frame(context, cr, x, y, width, height); ++ fp_gtk_render_check(context, cr, x, y, width, height); ++ disposeOrRestoreContext(context); + } + + +@@ -1680,7 +1776,6 @@ + gtk3_widget = gtk3_get_widget(widget_type); + + GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); +- + fp_gtk_style_context_save (context); + + if (detail != 0) { +@@ -1783,25 +1878,19 @@ + static void gtk3_paint_option(WidgetType widget_type, gint synth_state, + const gchar *detail, gint x, gint y, gint width, gint height) + { +- gtk3_widget = gtk3_get_widget(widget_type); +- +- GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); +- +- fp_gtk_style_context_save (context); ++ GtkStyleContext* context = get_style(widget_type, detail); + + GtkStateFlags flags = get_gtk_state_flags(synth_state); + if (gtk3_version_3_14 && (synth_state & SELECTED)) { +- flags = GTK_STATE_FLAG_CHECKED; ++ flags &= ~GTK_STATE_FLAG_SELECTED; ++ flags |= GTK_STATE_FLAG_CHECKED; + } + fp_gtk_style_context_set_state(context, flags); + +- if (detail != 0) { +- transform_detail_string(detail, context); +- } +- ++ fp_gtk_render_background(context, cr, x, y, width, height); ++ fp_gtk_render_frame(context, cr, x, y, width, height); + fp_gtk_render_option(context, cr, x, y, width, height); +- +- fp_gtk_style_context_restore (context); ++ disposeOrRestoreContext(context); + } + + static void gtk3_paint_shadow(WidgetType widget_type, GtkStateType state_type, +@@ -1860,15 +1949,7 @@ + gint x, gint y, gint width, gint height, GtkOrientation orientation, + gboolean has_focus) + { +- gtk3_widget = gtk3_get_widget(widget_type); +- +- GtkStyleContext* context = fp_gtk_widget_get_style_context (gtk3_widget); +- +- fp_gtk_style_context_save (context); +- +- if (detail) { +- transform_detail_string(detail, context); +- } ++ GtkStyleContext *context = get_style(widget_type, detail); + + GtkStateFlags flags = get_gtk_flags(state_type); + +@@ -1882,9 +1963,10 @@ + + fp_gtk_style_context_set_state (context, flags); + ++ fp_gtk_render_background (context, cr, x, y, width, height); ++ fp_gtk_render_frame(context, cr, x, y, width, height); + (*fp_gtk_render_slider)(context, cr, x, y, width, height, orientation); +- +- fp_gtk_style_context_restore (context); ++ disposeOrRestoreContext(context); + } + + static void gtk3_paint_background(WidgetType widget_type, +diff -r 619fc2e4250e -r fa3eed43d5fa src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h +--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h Fri Feb 15 10:06:25 2019 -0800 ++++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.h Fri Feb 15 10:58:57 2019 +0530 +@@ -162,6 +162,7 @@ + typedef void GtkRange; + typedef void GtkProgressBar; + typedef void GtkProgress; ++typedef void GtkWidgetPath; + + /* Some real structures */ + typedef struct +@@ -238,7 +239,6 @@ + GType owner_type; + } GParamSpec; + +- + static gchar* (*fp_glib_check_version)(guint required_major, + guint required_minor, guint required_micro); + +@@ -573,5 +573,18 @@ + static void (*fp_gtk_widget_size_request)(GtkWidget *widget, + GtkRequisition *requisition); + static GtkAdjustment* (*fp_gtk_range_get_adjustment)(GtkRange* range); ++static GtkWidgetPath* (*fp_gtk_widget_path_copy) ++ (const GtkWidgetPath *path); ++static const GtkWidgetPath* (*fp_gtk_style_context_get_path) ++ (GtkStyleContext *context); ++static GtkWidgetPath* (*fp_gtk_widget_path_new) (void); ++static gint (*fp_gtk_widget_path_append_type) ++ (GtkWidgetPath *path, GType type); ++static void (*fp_gtk_widget_path_iter_set_object_name) ++ (GtkWidgetPath *path, gint pos, const char *name); ++static void (*fp_gtk_style_context_set_path) ++ (GtkStyleContext *context, GtkWidgetPath *path); ++static void (*fp_gtk_widget_path_unref) (GtkWidgetPath *path); ++static GtkStyleContext* (*fp_gtk_style_context_new) (void); + + #endif /* !_GTK3_INTERFACE_H */ + diff -Nru openjdk-lts-11.0.3+4/debian/patches/keep-gtk2-as-default.patch openjdk-lts-11.0.3+5/debian/patches/keep-gtk2-as-default.patch --- openjdk-lts-11.0.3+4/debian/patches/keep-gtk2-as-default.patch 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/patches/keep-gtk2-as-default.patch 2019-03-28 10:00:21.000000000 +0000 @@ -0,0 +1,57 @@ +Description: Revert upstream default to GTK2 + OpenJDK 11 uses GTK3 by default for the GTK Look and Feel but it still + has too many pending issues and artifacts and is not on par with GTK2 + support. This patch is the reverse of the upstream commit which ensures + that GTK2 is tried before GTK3. + + When GTK3 becomes better supported we should drop this and update the + dlopen_jre_depends variable in debian/rules accordingly. +Origin: upstream, http://hg.openjdk.java.net/jdk-updates/jdk11u/rev/3e3696a308e1 +Bug: https://bugs.openjdk.java.net/browse/JDK-8198649, + https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8198654 +Bug-Ubuntu: https://launchpad.net/bugs/1770278 +Forwarded: not-needed +Applied-Upstream: http//hg.openjdk.java.net/jdk-updates/jdk11u/rev/3e3696a308e1 +Reviewed-by: +Last-Update: 2019-03-27 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ + +# HG changeset patch +# User prr +# Date 1521484190 25200 +# Node ID 3e3696a308e1674a1056d5ff0d660e7fb0d08286 +# Parent 79f6a4dc221e6290723e773813969de422733545 +8198649: Switch AWT/Swing's default GTK version to 3 +Reviewed-by: psadhukhan, kaddepalli + +diff -r 79f6a4dc221e -r 3e3696a308e1 src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c +--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c Mon Mar 19 10:46:31 2018 -0700 ++++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.c Mon Mar 19 11:29:50 2018 -0700 +@@ -45,18 +45,18 @@ + + static GtkLib gtk_libs[] = { + { +- GTK_3, +- JNI_LIB_NAME("gtk-3"), +- VERSIONED_JNI_LIB_NAME("gtk-3", "0"), +- >k3_load, +- >k3_check +- }, +- { + GTK_2, + JNI_LIB_NAME("gtk-x11-2.0"), + VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0"), + >k2_load, + >k2_check ++ }, ++ { ++ GTK_3, ++ JNI_LIB_NAME("gtk-3"), ++ VERSIONED_JNI_LIB_NAME("gtk-3", "0"), ++ >k3_load, ++ >k3_check + } + }; + + diff -Nru openjdk-lts-11.0.3+4/debian/patches/series openjdk-lts-11.0.3+5/debian/patches/series --- openjdk-lts-11.0.3+4/debian/patches/series 2019-02-27 14:55:48.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/patches/series 2019-03-28 10:00:21.000000000 +0000 @@ -35,3 +35,6 @@ reproducible-javadoc-timestamp.diff Don-t-optimize-fdlibm-fork-for-Zero-on-linux-sparc-Z.patch 8214002.diff +jdk-improve-gtk3-compatibility.patch +keep-gtk2-as-default.patch +8221083.diff diff -Nru openjdk-lts-11.0.3+4/debian/rules openjdk-lts-11.0.3+5/debian/rules --- openjdk-lts-11.0.3+4/debian/rules 2019-03-21 14:07:34.000000000 +0000 +++ openjdk-lts-11.0.3+5/debian/rules 2019-04-02 14:42:17.000000000 +0000 @@ -278,6 +278,12 @@ export CXX = $(DEB_HOST_GNU_TYPE)-g++-8 endif +# until we are able to b-d on gcc-for-host ... +ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) + export CC = $(DEB_HOST_GNU_TYPE)-gcc + export CXX = $(DEB_HOST_GNU_TYPE)-g++ +endif + with_pulse = yes with_pulse = @@ -383,6 +389,35 @@ DEFAULT_CONFIGURE_ARGS += --with-jvm-features=zgc endif +ifeq ($(distribution),Debian) + COMMON_CONFIGURE_ARGS += \ + --with-vendor-name='$(distribution)' \ + --with-vendor-url='https://tracker.debian.org/$(basename)' \ + --with-vendor-bug-url='https://bugs.debian.org/$(basename)' \ + --with-vendor-vm-bug-url='https://bugs.debian.org/$(basename)' +else ifeq ($(distribution),Ubuntu) + ppa_build := $(shell if echo '$(v_pkgrel)' | egrep '^[0-9]+(ubuntu[0-9]+)?(~[0-9.]+)?$$'; then echo no; else echo yes; fi) + ifeq ($(ppa_build),yes) + COMMON_CONFIGURE_ARGS += \ + --with-vendor-name='Private Build' \ + --with-vendor-url='Unknown' \ + --with-vendor-bug-url='Unknown' \ + --with-vendor-vm-bug-url='Unknown' + else + COMMON_CONFIGURE_ARGS += \ + --with-vendor-name='$(distribution)' \ + --with-vendor-url='https://ubuntu.com/' \ + --with-vendor-bug-url='https://bugs.launchpad.net/ubuntu/+source/openjdk-lts' \ + --with-vendor-vm-bug-url='https://bugs.launchpad.net/ubuntu/+source/openjdk-lts' + endif +else + COMMON_CONFIGURE_ARGS += \ + --with-vendor-name='$(distribution)' \ + --with-vendor-url='Unknown' \ + --with-vendor-bug-url='Unknown' \ + --with-vendor-vm-bug-url='Unknown' +endif + COMMON_CONFIGURE_ARGS += \ --with-version-pre='' \ --with-version-build='$(v_upbuild)' \ @@ -474,9 +509,9 @@ bd_autotools = autoconf, automake, autotools-dev, ifneq (,$(filter $(distrel),squeeze wheezy jessie precise trusty xenial)) - bd_bootstrap = openjdk-10-jdk-headless | openjdk-11-jdk-headless, + bd_bootstrap = openjdk-10-jdk-headless:native | openjdk-11-jdk-headless:native, else - bd_bootstrap = openjdk-11-jdk-headless | openjdk-10-jdk-headless, + bd_bootstrap = openjdk-11-jdk-headless:native | openjdk-10-jdk-headless:native, endif ifeq (,$(filter $(distrel),squeeze wheezy jessie precise trusty xenial)) bd_cross += \ @@ -501,11 +536,11 @@ else ifneq (,$(filter $(distrel),wily xenial)) bd_gcc = g++-5 [$(hotspot_archs)], g++-4.9 [$(strip $(foreach a,$(hotspot_archs), !$(a)))], g++-4.9 [arm64], else ifneq (,$(filter $(distrel),stretch)) - bd_gcc = g++-6, + bd_gcc = g++-6 , else ifneq (,$(filter $(distrel),artful bionic)) - bd_gcc = g++-7, + bd_gcc = g++-7 , else - bd_gcc = g++-8, + bd_gcc = g++-8 , endif bd_syslibs = zlib1g-dev, libattr1-dev, ifneq (,$(filter $(distrel),squeeze lucid)) @@ -570,7 +605,7 @@ endif dlopen_hl_recommends = dlopen_jre_depends = \ - libglib2.0-0 (>= 2.24), libgtk-3-0, libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1 + libglib2.0-0 (>= 2.24), libgtk2.0-0 | libgtk-3-0, libxrandr2, libxinerama1, libgl1-mesa-glx | libgl1 dlopen_jre_recommends = # .desktop files need to be multiarch installable @@ -1653,7 +1688,7 @@ is_release = yes hg_project = jdk11u -hg_tag = jdk-11.0.3+4 +hg_tag = jdk-11.0.3+5 package_version = $(subst jdk-,,$(hg_tag)) ifneq ($(is_release),yes) package_version := $(subst +,~,$(package_version)) diff -Nru openjdk-lts-11.0.3+4/.hg_archival.txt openjdk-lts-11.0.3+5/.hg_archival.txt --- openjdk-lts-11.0.3+4/.hg_archival.txt 2018-12-18 13:43:54.000000000 +0000 +++ openjdk-lts-11.0.3+5/.hg_archival.txt 2019-03-21 08:16:58.000000000 +0000 @@ -1,4 +1,4 @@ repo: fd16c54261b32be1aaedd863b7e856801b7f8543 -node: 43d6759c3b2e36c1118e9753a080372294e1f17a +node: c9865fee1a6d39a7bd2a5313f54c812d9a0852f5 branch: default -tag: jdk-11.0.3+4 +tag: jdk-11.0.3+5 diff -Nru openjdk-lts-11.0.3+4/.hgtags openjdk-lts-11.0.3+5/.hgtags --- openjdk-lts-11.0.3+4/.hgtags 2018-12-18 13:43:54.000000000 +0000 +++ openjdk-lts-11.0.3+5/.hgtags 2019-03-21 08:16:58.000000000 +0000 @@ -537,3 +537,4 @@ cd1c042181e934a1a91f9ee59a0066f64c8bad7a jdk-11.0.3+1 9de3f198995c6c384fd6431c97089c311ec6a7ff jdk-11.0.3+2 d17a1764a0f318ab72beadb589c998d40951493a jdk-11.0.3+3 +43d6759c3b2e36c1118e9753a080372294e1f17a jdk-11.0.3+4 diff -Nru openjdk-lts-11.0.3+4/test/jdk/java/util/Scanner/ScanTest.java openjdk-lts-11.0.3+5/test/jdk/java/util/Scanner/ScanTest.java --- openjdk-lts-11.0.3+4/test/jdk/java/util/Scanner/ScanTest.java 2018-12-18 13:43:54.000000000 +0000 +++ openjdk-lts-11.0.3+5/test/jdk/java/util/Scanner/ScanTest.java 2019-03-21 08:16:58.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2019, 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 @@ -24,7 +24,7 @@ /** * @test * @bug 4313885 4926319 4927634 5032610 5032622 5049968 5059533 6223711 6277261 6269946 6288823 - * 8072722 8139414 8166261 + * 8072722 8139414 8166261 8172695 * @summary Basic tests of java.util.Scanner methods * @key randomness * @modules jdk.localedata @@ -49,26 +49,12 @@ private static File inputFile = new File(System.getProperty("test.src", "."), "input.txt"); public static void main(String[] args) throws Exception { - - Locale reservedLocale = Locale.getDefault(); - String lang = reservedLocale.getLanguage(); + Locale defaultLocale = Locale.getDefault(); try { - if (!"en".equals(lang) && - !"zh".equals(lang) && - !"ko".equals(lang) && - !"ja".equals(lang)) { - //Before we have resource to improve the test to be ready for - //arbitrary locale, force the default locale to be "English" - //for now. First we check whether the "English" locale is - //available on the system as it could be absent due to varying - //configurations. - if (!Arrays.asList(Locale.getAvailableLocales()) - .contains(Locale.ENGLISH)) { - throw new RuntimeException - ("The \"English\" Locale is unavailable on this system"); - } - Locale.setDefault(Locale.ENGLISH); - } + // Before we have resource to improve the test to be ready for + // arbitrary locale, force the default locale to be ROOT for now. + Locale.setDefault(Locale.US); + skipTest(); findInLineTest(); findWithinHorizonTest(); @@ -128,7 +114,7 @@ System.err.println("OKAY: All tests passed."); } finally { // restore the default locale - Locale.setDefault(reservedLocale); + Locale.setDefault(defaultLocale); } }