8214253: Tooltip is transparent rather than having a black background
authorpbansal
Tue, 05 Mar 2019 13:09:15 +0530
changeset 54234 6b2f2ec0f618
parent 54233 9413f1a4dc2b
child 54235 63946f20c24f
8214253: Tooltip is transparent rather than having a black background Reviewed-by: serb, psadhukhan
src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c
--- a/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c	Mon Mar 04 01:44:41 2019 -0800
+++ b/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c	Tue Mar 05 13:09:15 2019 +0530
@@ -1777,13 +1777,9 @@
         (widget_type == CHECK_BOX || widget_type == RADIO_BUTTON)) {
         return;
     }
-    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);
+    GtkStyleContext* context = get_style(widget_type, detail);
+    if (widget_type == TOOL_TIP) {
+        fp_gtk_style_context_add_class(context, "background");
     }
 
     GtkStateFlags flags = get_gtk_flags(state_type);
@@ -1800,7 +1796,7 @@
 
     fp_gtk_render_background (context, cr, x, y, width, height);
 
-    fp_gtk_style_context_restore (context);
+    disposeOrRestoreContext(context);
 }
 
 static void gtk3_paint_focus(WidgetType widget_type, GtkStateType state_type,
@@ -2365,12 +2361,12 @@
         widget_type = TEXT_AREA;
     }
 
-    gtk3_widget = gtk3_get_widget(widget_type);
-
-    GtkStyleContext* context = fp_gtk_widget_get_style_context(gtk3_widget);
-
+    GtkStyleContext* context = NULL;
     if (widget_type == TOOL_TIP) {
-        fp_gtk_style_context_add_class(context, "tooltip");
+        context = get_style(widget_type, "tooltip");
+    } else {
+        gtk3_widget = gtk3_get_widget(widget_type);
+        context = fp_gtk_widget_get_style_context(gtk3_widget);
     }
     if (widget_type == CHECK_BOX_MENU_ITEM
      || widget_type == RADIO_BUTTON_MENU_ITEM) {
@@ -2388,7 +2384,9 @@
 
     result = recode_color(color.alpha) << 24 | recode_color(color.red) << 16 |
              recode_color(color.green) << 8 | recode_color(color.blue);
-
+    if (widget_type == TOOL_TIP) {
+        disposeOrRestoreContext(context);
+    }
     return result;
 }