From fe9fff27294dfef4b01e174c86e7a4d10a387a15 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 30 Aug 2024 18:11:27 +0200 Subject: [PATCH] clutter: Make detached actions let events through Actions might get detached sometime during event processing, at a time that the stage did already prepare an emission chain holding references to the actions and actors that need to handle events. This means actions might become detached, but still handle the incoming event, or possible crossing events generated in-place when the actor becomes unparented. Avoid this situation, by skipping event handling on actions that went detached, we will just instruct to continue event processing. Part-of: --- clutter/clutter/clutter-action.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-action.c b/clutter/clutter/clutter-action.c index 62148dea7..e6391b900 100644 --- a/clutter/clutter/clutter-action.c +++ b/clutter/clutter/clutter-action.c @@ -99,10 +99,11 @@ gboolean clutter_action_handle_event (ClutterAction *action, const ClutterEvent *event) { - gboolean retval; + gboolean retval = CLUTTER_EVENT_PROPAGATE; g_object_ref (action); - retval = CLUTTER_ACTION_GET_CLASS (action)->handle_event (action, event); + if (clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (action))) + retval = CLUTTER_ACTION_GET_CLASS (action)->handle_event (action, event); g_object_unref (action); return retval;