This patch fixes the problem along the lines proposed in the previous
message. The patch was tested against version openjdk-6_6b18-1.8.3-2
+squeeze1.

As the actual jdk source is extracted during the build, the patch must
be applied afterwards, and libmawt must be rebuilt. I have sniped the
relevant gcc invocations from a build log to get a fast turnaround for
tests - They are attached, however they are specific to amd64.

The patch itself is just a normal source patch for gtk_interface.c and
its header. I still do not know how it can be added to the debian
patches, but you will probably know, how to do it.

Finally, there is a screenshot of the result. 
=== modified file 'build/openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c'
--- build/openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c	2011-03-12 18:54:29 +0000
+++ build/openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.c	2011-03-12 19:24:20 +0000
@@ -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,22 @@
     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;
 }
 
 /*************************************************/
@@ -1970,6 +1983,23 @@
 }
 
 /*************************************************/
+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_Boolean(JNIEnv *env, jboolean boolean_value);
 jobject create_Integer(JNIEnv *env, jint int_value);
 jobject create_Long(JNIEnv *env, jlong long_value);

=== modified file 'build/openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h'
--- build/openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h	2011-03-12 18:54:29 +0000
+++ build/openjdk/jdk/src/solaris/native/sun/awt/gtk2_interface.h	2011-03-12 19:24:20 +0000
@@ -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: compile.sh
Description: application/shellscript

Attachment: link.sh
Description: application/shellscript

<<attachment: Fixed.png>>

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

Reply via email to