[gtk+/gtk-style-context] GtkStyleContext: Handle empty areas when coalescing invalidation regions.



commit 87ea69bc7ac3e80666d8c1c12395de92985b0a49
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Nov 24 03:02:01 2010 +0100

    GtkStyleContext: Handle empty areas when coalescing invalidation regions.

 gtk/gtkstylecontext.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index e5bd4cf..6dac9bd 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2728,21 +2728,28 @@ _gtk_style_context_coalesce_animation_areas (GtkStyleContext *context,
   if (!priv->animations_invalidated)
     return;
 
-  for (l = priv->animations; l; l = l->next)
+  l = priv->animations;
+
+  while (l)
     {
       AnimationInfo *info;
+      GSList *cur;
       guint i;
 
-      info = l->data;
+      cur = l;
+      info = cur->data;
+      l = l->next;
 
       if (info->invalidation_region)
         continue;
 
-      /* FIXME: If this happens there's not much
-       * point in keeping the animation running.
-       */
+      /* There's not much point in keeping the animation running */
       if (info->rectangles->len == 0)
-        continue;
+        {
+          priv->animations = g_slist_remove (priv->animations, info);
+          animation_info_free (info);
+          continue;
+        }
 
       info->invalidation_region = cairo_region_create ();
 



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