diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2012-06-24 11:49:03 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2012-06-26 16:12:57 +0100 |
commit | df592e83053836c20df5185d18aa23e4aef6215a (patch) | |
tree | 6b8bf065816da0079ab8a58e83e6f6202a4c0379 | |
parent | d8e17389ce8025f7ef22c76678a55807ba444826 (diff) | |
download | clutter-df592e83053836c20df5185d18aa23e4aef6215a.tar.gz |
actor: Allow actions to handle events before capture/bubble
ClutterAction should have a separate event handling cycle, to avoid
connecting to signals and thus relying on undefined implicit ordering,
as opposed to the actual addition order.
-rw-r--r-- | clutter/clutter-actor.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 12d5fdae4..cd08e4850 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -594,7 +594,7 @@ #include "clutter-actor-private.h" -#include "clutter-action.h" +#include "clutter-action-private.h" #include "clutter-actor-meta-private.h" #include "clutter-animatable.h" #include "clutter-color-static.h" @@ -18925,6 +18925,26 @@ _clutter_actor_handle_event (ClutterActor *self, iter = parent; } + /* we run the actions attached to an actor before capture/bubble; this + * allows the actions to have control over the event emission chain + * without interfering with it, and without relying on implicit or + * undefined ordering. + */ + if (self->priv->actions != NULL) + { + const GList *l; + + for (l = _clutter_meta_group_peek_metas (self->priv->actions); + l != NULL; + l = l->next) + { + ClutterAction *action = l->data; + + if (clutter_actor_meta_get_enabled (l->data)) + _clutter_action_handle_event (action, event); + } + } + /* Capture: from top-level downwards */ for (i = event_tree->len - 1; i >= 0; i--) if (clutter_actor_event (g_ptr_array_index (event_tree, i), event, TRUE)) |