diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-07-22 18:01:22 -0700 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-07-22 20:20:07 -0700 |
commit | 8eded0ba62bdfab2e30562d3eef73c0facbdd098 (patch) | |
tree | 90abe71b8cf51ed1dd238bbff50e9942fe25802d | |
parent | b25214aa26c179507ab76cea03870396690684a2 (diff) | |
download | gtk+-smooth-cursor.tar.gz |
text: Fix incomplete invalidationsmooth-cursor
When a style change affects the text, we need to
clear the cached content, in order to pick up the
new text style.
-rw-r--r-- | gtk/gtktext.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 9b3a7a014c..d57b994d32 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -3293,10 +3293,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 |