Skip to content

Commit

Permalink
bug 1197165 apply tooltip style class when creating window instead of…
Browse files Browse the repository at this point in the history
… when drawing r=acomminos

This is consistent with gtktooltip.c.

gtk_style_context_save() modifies the CSS node hierarchy causing this rule to
incorrectly match:

.tooltip * {
        background-color: transparent;
}

See also https://bugzilla.gnome.org/show_bug.cgi?id=761870#c2

--HG--
extra : rebase_source : baa16e2ca297db702aa5d9250fd3d9606dcf891a
  • Loading branch information
karlt committed Mar 2, 2016
1 parent 5c5c740 commit 3c21b4d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions widget/gtk/gtk3drawing.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ ensure_tooltip_widget()
{
if (!gTooltipWidget) {
gTooltipWidget = gtk_window_new(GTK_WINDOW_POPUP);
GtkStyleContext* style = gtk_widget_get_style_context(gTooltipWidget);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP);
gtk_widget_realize(gTooltipWidget);
moz_gtk_set_widget_name(gTooltipWidget);
}
Expand Down Expand Up @@ -1946,11 +1948,8 @@ moz_gtk_tooltip_paint(cairo_t *cr, GdkRectangle* rect,
gtk_widget_set_direction(gTooltipWidget, direction);

style = gtk_widget_get_style_context(gTooltipWidget);
gtk_style_context_save(style);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_TOOLTIP);
gtk_render_background(style, cr, rect->x, rect->y, rect->width, rect->height);
gtk_render_frame(style, cr, rect->x, rect->y, rect->width, rect->height);
gtk_style_context_restore(style);
return MOZ_GTK_SUCCESS;
}

Expand Down

0 comments on commit 3c21b4d

Please sign in to comment.