[gtk/smooth-cursor: 2/3] text view: Fix incomplete invalidation
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/smooth-cursor: 2/3] text view: Fix incomplete invalidation
- Date: Tue, 23 Jul 2019 06:02:28 +0000 (UTC)
commit b25214aa26c179507ab76cea03870396690684a2
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jul 22 17:42:25 2019 -0700
text view: Fix incomplete invalidation
Update the cached text style when a css change affects
content or background. This fixes text views drawing
black-on-dark when switching to the dark theme.
gtk/gtktextview.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 4b30b8d653..db358cef01 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -4573,11 +4573,15 @@ gtk_text_view_style_updated (GtkWidget *widget)
style_context = gtk_widget_get_style_context (widget);
change = gtk_style_context_get_change (style_context);
- if ((change == NULL || gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT)) &&
+ if ((change == NULL ||
+ gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT |
+ GTK_CSS_AFFECTS_BACKGROUND |
+ GTK_CSS_AFFECTS_CONTENT)) &&
priv->layout && priv->layout->default_style)
{
gtk_text_view_set_attributes_from_style (text_view,
priv->layout->default_style);
+ gtk_text_layout_default_style_changed (priv->layout);
ltr_context = gtk_widget_create_pango_context (widget);
pango_context_set_base_dir (ltr_context, PANGO_DIRECTION_LTR);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]