changeset 13495:0efb8d935281

8214253: Tooltip is transparent rather than having a black background Reviewed-by: serb, psadhukhan
author pbansal
date Tue, 05 Mar 2019 13:09:15 +0530
parents 6a54110f573c
children 0ff0f14d5346
files src/solaris/native/sun/awt/gtk3_interface.c
diffstat 1 files changed, 12 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/sun/awt/gtk3_interface.c	Fri Feb 15 10:58:57 2019 +0530
+++ b/src/solaris/native/sun/awt/gtk3_interface.c	Tue Mar 05 13:09:15 2019 +0530
@@ -1773,13 +1773,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);
@@ -1796,7 +1792,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,
@@ -2361,12 +2357,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) {
@@ -2384,7 +2380,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;
 }