[gtk/matthiasc/for-master] widget: Queue a draw when we need to



commit 40d7092f4a73cecc6275895643ada709e05632a4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 23 17:07:37 2020 -0400

    widget: Queue a draw when we need to
    
    The code in gtk_widget_real_css_changed assumes that
    queue_resize > queue_allocate > queue_draw, but the
    second one is not really true. These days, we happily
    keep reusing the same render node even when the child
    allocation is changed.
    
    So, if a css change has flags that tell us we should
    redraw, we need to queue a draw, otherwise we might
    end up reusing an outdated render node.
    
    This fixes spinners staying visible when they stop
    spinning, despite the theme setting their opacity
    to 0.

 gtk/gtkwidget.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8dfb157e87..9f538f42ea 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4674,8 +4674,9 @@ gtk_widget_real_css_changed (GtkWidget         *widget,
             {
               gtk_widget_queue_allocate (priv->parent);
             }
-          else if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_REDRAW) ||
-                   (has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_CONTENT)))
+
+          if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_REDRAW) ||
+              (has_text && gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_CONTENT)))
             {
               gtk_widget_queue_draw (widget);
             }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]