[gtk+] stylecontext: don't unset the current style info when clearing cache



commit 77b876fad3a04c6ba8b71b3ff62df1ac9681b633
Author: Benjamin Otte <otte redhat com>
Date:   Mon Oct 27 04:22:49 2014 +0100

    stylecontext: don't unset the current style info when clearing cache
    
    Instead, do it manually.

 gtk/gtkstylecontext.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 05d5b13..c27ea3d 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2626,8 +2626,6 @@ gtk_style_context_clear_cache (GtkStyleContext *context)
 
   priv = context->priv;
 
-  style_info_set_values (priv->info, NULL);
-
   for (l = priv->saved_nodes; l; l = l->next)
     {
       style_info_set_values (l->data, NULL);
@@ -2781,6 +2779,8 @@ _gtk_style_context_validate (GtkStyleContext  *context,
   if (!priv->invalid && change == 0 && _gtk_bitmask_is_empty (parent_changes))
     return;
 
+  g_assert (!gtk_style_context_is_saved (context));
+
   priv->pending_changes = 0;
   gtk_style_context_set_invalid (context, FALSE);
 
@@ -2803,9 +2803,9 @@ _gtk_style_context_validate (GtkStyleContext  *context,
       else
         {
           gtk_style_context_update_cache (context, parent_changes);
-          style_info_set_values (info, NULL);
         }
 
+      style_info_set_values (info, NULL);
       values = style_values_lookup (context);
 
       if (values != current)
@@ -2912,6 +2912,8 @@ gtk_style_context_invalidate (GtkStyleContext *context)
 
   gtk_style_context_clear_cache (context);
 
+  style_info_set_values (context->priv->info, NULL);
+
   changes = _gtk_bitmask_new ();
   changes = _gtk_bitmask_invert_range (changes,
                                        0,


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