From 037c982824a9e1353fd903ffe2bba0c97f23042e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Wed, 24 Nov 2010 03:02:01 +0100 Subject: [PATCH] GtkStyleContext: Handle empty areas when coalescing invalidation regions. --- gtk/gtkstylecontext.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index e5bd4cf683..6dac9bdf3b 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 ();