text: Fix incomplete invalidation

When a style change affects the text, we need to
clear the cached content, in order to pick up the
new text style.
This commit is contained in:
Matthias Clasen 2019-07-22 18:01:22 -07:00
parent c39cc15573
commit 758c54eab8

View File

@ -3262,10 +3262,21 @@ static void
gtk_text_style_updated (GtkWidget *widget)
{
GtkText *self = GTK_TEXT (widget);
GtkStyleContext *context;
GtkCssStyleChange *change = NULL;
context = gtk_widget_get_style_context (widget);
change = gtk_style_context_get_change (context);
GTK_WIDGET_CLASS (gtk_text_parent_class)->style_updated (widget);
gtk_text_update_cached_style_values (self);
if (change == NULL ||
gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT |
GTK_CSS_AFFECTS_BACKGROUND |
GTK_CSS_AFFECTS_CONTENT))
gtk_text_queue_draw (GTK_WIDGET (self));
}
static void