8220349: The fix done for JDK-8214253 have caused issues in JTree behaviour
authorpbansal
Thu, 04 Apr 2019 12:14:51 +0530
changeset 54503 e64a8477cd71
parent 54502 d95d9d034034
child 54504 55b0469425e1
8220349: The fix done for JDK-8214253 have caused issues in JTree behaviour Reviewed-by: serb, prr
src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c	Wed Apr 03 15:56:29 2019 -0700
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c	Thu Apr 04 12:14:51 2019 +0530
@@ -1777,9 +1777,18 @@
         (widget_type == CHECK_BOX || widget_type == RADIO_BUTTON)) {
         return;
     }
-    GtkStyleContext* context = get_style(widget_type, detail);
+
+    GtkStyleContext* context = NULL;
     if (widget_type == TOOL_TIP) {
+        context = get_style(widget_type, detail);
         fp_gtk_style_context_add_class(context, "background");
+    } else {
+        gtk3_widget = gtk3_get_widget(widget_type);
+        context = fp_gtk_widget_get_style_context (gtk3_widget);
+        fp_gtk_style_context_save (context);
+        if (detail != 0) {
+            transform_detail_string(detail, context);
+        }
     }
 
     GtkStateFlags flags = get_gtk_flags(state_type);
@@ -1795,8 +1804,11 @@
     }
 
     fp_gtk_render_background (context, cr, x, y, width, height);
-
-    disposeOrRestoreContext(context);
+    if (widget_type == TOOL_TIP) {
+        disposeOrRestoreContext(context);
+    } else {
+        fp_gtk_style_context_restore (context);
+    }
 }
 
 static void gtk3_paint_focus(WidgetType widget_type, GtkStateType state_type,