animator: only keys that are removed due to actors disappearing are inert
authorØyvind Kolås <pippin@linux.intel.com>
Wed, 5 May 2010 15:55:16 +0000 (16:55 +0100)
committerØyvind Kolås <pippin@linux.intel.com>
Wed, 5 May 2010 17:24:53 +0000 (18:24 +0100)
clutter/clutter-animator.c

index 36cfca7..4a596ad 100644 (file)
@@ -354,12 +354,19 @@ sort_actor_prop_func (gconstpointer a,
   return pa->object - pb->object;
 }
 
+static void
+clutter_animator_remove_key_internal (ClutterAnimator *animator,
+                                      GObject         *object,
+                                      const gchar     *property_name,
+                                      gdouble          progress,
+                                      gboolean         is_inert);
 
 static void
 object_disappeared (gpointer  data,
                     GObject  *where_the_object_was)
 {
-  clutter_animator_remove_key (data, where_the_object_was, NULL, -1.0);
+  clutter_animator_remove_key_internal (data, where_the_object_was, NULL, -1.0,
+                                        TRUE);
 }
 
 static ClutterAnimatorKey *
@@ -1380,24 +1387,12 @@ clutter_animator_get_keys (ClutterAnimator *animator,
   return g_list_reverse (keys);
 }
 
-/**
- * clutter_animator_remove_key:
- * @animator: a #ClutterAnimator
- * @object: (allow-none): a #GObject to search for, or %NULL for all
- * @property_name: (allow-none): a specific property name to query for,
- *   or %NULL for all
- * @progress: a specific progress to search for or a negative value
- *   for all
- *
- * Removes all keys matching the conditions specificed in the arguments.
- *
- * Since: 1.2
- */
-void
-clutter_animator_remove_key (ClutterAnimator *animator,
-                             GObject         *object,
-                             const gchar     *property_name,
-                             gdouble          progress)
+static void
+clutter_animator_remove_key_internal (ClutterAnimator *animator,
+                                      GObject         *object,
+                                      const gchar     *property_name,
+                                      gdouble          progress,
+                                      gboolean         is_inert)
 {
   ClutterAnimatorPrivate *priv;
   GList *k;
@@ -1419,7 +1414,7 @@ clutter_animator_remove_key (ClutterAnimator *animator,
          )
         {
           ClutterAnimatorKey *prev_key = NULL;
-          key->is_inert = TRUE;
+          key->is_inert = is_inert;
 
           clutter_animator_key_free (key);
 
@@ -1465,6 +1460,29 @@ again:
     }
 }
 
+/**
+ * clutter_animator_remove_key:
+ * @animator: a #ClutterAnimator
+ * @object: (allow-none): a #GObject to search for, or %NULL for all
+ * @property_name: (allow-none): a specific property name to query for,
+ *   or %NULL for all
+ * @progress: a specific progress to search for or a negative value
+ *   for all
+ *
+ * Removes all keys matching the conditions specificed in the arguments.
+ *
+ * Since: 1.2
+ */
+void
+clutter_animator_remove_key (ClutterAnimator *animator,
+                             GObject         *object,
+                             const gchar     *property_name,
+                             gdouble          progress)
+{
+  clutter_animator_remove_key_internal (animator, object, property_name, 
+                                        progress, FALSE);
+}
+