[gtk+/cellarea-style-transitions: 2/10] stylecontext: only coalesce transitions after they're referenced by a draw()



commit 7e6cd377f9394bee0226f6b3b9483b699c1f338f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 10 23:59:27 2011 +0200

    stylecontext: only coalesce transitions after they're referenced by a draw()
    
    If after calling _gtk_style_context_invalidate_animation_areas(), a widget
    happened to draw() with a clipping area that left out some transition, it
    would be left stuck with a NULL invalidation area.

 gtk/gtkstylecontext.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 6bd095d..f6e4eab 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3155,6 +3155,7 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
 					     GtkWidget       *widget)
 {
   GtkStyleContextPrivate *priv;
+  gboolean validate = TRUE;
   GSList *l;
 
   priv = context->priv;
@@ -3178,7 +3179,10 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
         continue;
 
       if (info->rectangles->len == 0)
-        continue;
+        {
+          validate = FALSE;
+          continue;
+        }
 
       info->invalidation_region = cairo_region_create ();
 
@@ -3193,7 +3197,8 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
       g_array_remove_range (info->rectangles, 0, info->rectangles->len);
     }
 
-  priv->animations_invalidated = FALSE;
+  if (validate)
+    priv->animations_invalidated = FALSE;
 }
 
 static void



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