From d39277d0cf96e2a4ac7b5cc3f587b5fba1f48610 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Fri, 19 Nov 2010 12:26:57 +0000 Subject: [PATCH] actor: Reset the last paint box on unmap This allows hiding + moving + showing an actor without repainting the wrong area. http://bugzilla.clutter-project.org/show_bug.cgi?id=2395 --- clutter/clutter-actor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index e7e8e873c..34b40dead 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1091,6 +1091,12 @@ clutter_actor_real_unmap (ClutterActor *self) CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_MAPPED); + /* unset the contents of the last paint box, so that hiding + moving + + * showing will not result in the wrong area being repainted + */ + memset (&self->priv->last_paint_box, 0, sizeof (ClutterActorBox)); + self->priv->last_paint_box_valid = TRUE; + /* notify on parent mapped after potentially unmapping * children, so apps see a bottom-up notification. */ @@ -4854,10 +4860,7 @@ clutter_actor_init (ClutterActor *self) priv->enable_model_view_transform = TRUE; /* Initialize an empty paint box to start with */ - priv->last_paint_box.x1 = 0; - priv->last_paint_box.y1 = 0; - priv->last_paint_box.x2 = 0; - priv->last_paint_box.y2 = 0; + memset (&priv->last_paint_box, 0, sizeof (ClutterActorBox)); priv->last_paint_box_valid = TRUE; memset (priv->clip, 0, sizeof (gfloat) * 4);