← Back to team overview

openjdk team mailing list archive

Bug#613134: Fix for debian package

 

Here is a patch (debdiff) for the debian package.
It actually uses the Stefan's patch and apply it to the openjdk source
when building the package.

Can someone please review this patch?

-- 
Guillaume Mazoyer - http://www.respawner.fr/
diff -u openjdk-6-6b22-1.10.1/debian/rules openjdk-6-6b22-1.10.1/debian/rules
--- openjdk-6-6b22-1.10.1/debian/rules
+++ openjdk-6-6b22-1.10.1/debian/rules
@@ -294,6 +294,7 @@
 	debian/patches/nonreparenting-wm.diff \
 	debian/patches/java-access-bridge-security.patch \
 	debian/patches/accessible-toolkit.patch \
+	debian/patches/gtk2-menu-separator.patch \
 
 ifeq ($(with_hotspot),original)
   DISTRIBUTION_PATCHES += \
diff -u openjdk-6-6b22-1.10.1/debian/changelog openjdk-6-6b22-1.10.1/debian/changelog
--- openjdk-6-6b22-1.10.1/debian/changelog
+++ openjdk-6-6b22-1.10.1/debian/changelog
@@ -1,3 +1,10 @@
+openjdk-6 (6b22-1.10.1-2) experimental; urgency=low
+
+  * Add patch to fix menu separators in swing with gtk style.
+    Closes: 613134
+
+ -- Guillaume Mazoyer <respawneral@xxxxxxxxx>  Thu, 14 Apr 2011 10:45:39 +0200
+
 openjdk-6 (6b22-1.10.1-1) experimental; urgency=low
 
   *  Upload to experimental.
only in patch2:
unchanged:
--- openjdk-6-6b22-1.10.1.orig/debian/patches/gtk2-menu-separator.patch
+++ openjdk-6-6b22-1.10.1/debian/patches/gtk2-menu-separator.patch
@@ -0,0 +1,74 @@
+diff -Nru openjdk.orig/jdk/src/solaris/native/sun/awt/gtk2_interface.c openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c
+--- openjdk.orig/jdk/src/solaris/native/sun/awt/gtk2_interface.c	2011-02-28 17:06:50.000000000 +0100
++++ openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c	2011-04-13 22:41:06.173951371 +0200
+@@ -1899,8 +1899,7 @@
+     init_containers();
+ 
+     gtk2_widget = gtk2_get_widget(widget_type);
+-    GtkStyle* style = gtk2_widget->style;
+-    return style->xthickness;
++    return gtk2_widget->style->xthickness;
+ }
+ 
+ gint gtk2_get_ythickness(JNIEnv *env, WidgetType widget_type)
+@@ -1908,8 +1907,21 @@
+     init_containers();
+ 
+     gtk2_widget = gtk2_get_widget(widget_type);
+-    GtkStyle* style = gtk2_widget->style;
+-    return style->ythickness;
++    gint thickness =  gtk2_widget->style->ythickness;
++
++    if (widget_type == POPUP_MENU_SEPARATOR)
++    {
++        gboolean wide_separators = gtk2_get_widget_style_property_boolean(
++                gtk2_widget, "wide-separators");
++        if (wide_separators)
++        {
++            gint separator_height = gtk2_get_widget_style_property_int(
++                    gtk2_widget, "separator-height");
++            return separator_height / 2;
++        }
++    }
++
++    return thickness;
+ }
+ 
+ /*************************************************/
+@@ -2117,6 +2129,22 @@
+     adj->page_size = (gdouble)visible;
+ }
+ 
++gboolean gtk2_get_widget_style_property_boolean(GtkWidget* widget, const char* property_name) {
++    GValue value;
++    value.g_type = 0;
++    (*fp_g_value_init)(&value, G_TYPE_BOOLEAN);
++    (*fp_gtk_widget_style_get_property)(widget, property_name, &value);
++    return (*fp_g_value_get_boolean)(&value);
++}
++
++gint gtk2_get_widget_style_property_int(GtkWidget* widget, const char* property_name) {
++    GValue value;
++    value.g_type = 0;
++    (*fp_g_value_init)(&value, G_TYPE_INT);
++    (*fp_gtk_widget_style_get_property)(widget, property_name, &value);
++    return (*fp_g_value_get_int)(&value);
++}
++
+ /*************************************************/
+ jobject create_Object(JNIEnv *env, jmethodID *cid,
+                              const char* class_name,
+diff -Nru openjdk.orig/jdk/src/solaris/native/sun/awt/gtk2_interface.h openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h
+--- openjdk.orig/jdk/src/solaris/native/sun/awt/gtk2_interface.h	2011-02-28 17:06:50.000000000 +0100
++++ openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h	2011-04-13 22:36:17.980522296 +0200
+@@ -637,6 +637,10 @@
+ gint gtk2_get_ythickness(JNIEnv *env, WidgetType widget_type);
+ gint gtk2_get_color_for_state(JNIEnv *env, WidgetType widget_type,
+                               GtkStateType state_type, ColorType color_type);
++gboolean gtk2_get_widget_style_property_boolean(GtkWidget* widget,
++                                                const char* property_name);
++gint gtk2_get_widget_style_property_int(GtkWidget* widget,
++                                        const char* property_name);
+ jobject gtk2_get_class_value(JNIEnv *env, WidgetType widget_type, jstring key);
+ 
+ GdkPixbuf *gtk2_get_stock_icon(gint widget_type, const gchar *stock_id,

Attachment: signature.asc
Description: This is a digitally signed message part