From 249274c67705614fa14c95808283d14a38302fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 6 Jul 2020 21:33:32 +0200 Subject: [PATCH] clutter/actor: Pass stage as user_data when unrealizing We can avoid having to get the stage again for every child of the subtree we're unrealizing by getting the stage once and passing it as user_data to the callbacks. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1356 --- clutter/clutter/clutter-actor.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index d3ca1b22d..9bafacac5 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -2201,7 +2201,7 @@ unrealize_actor_after_children_cb (ClutterActor *self, int depth, void *user_data) { - ClutterActor *stage = _clutter_actor_get_stage_internal (self); + ClutterActor *stage = user_data; /* We want to unset the realized flag only _after_ * child actors are unrealized, to maintain invariants. @@ -2244,11 +2244,13 @@ unrealize_actor_after_children_cb (ClutterActor *self, static void clutter_actor_unrealize_not_hiding (ClutterActor *self) { + ClutterActor *stage = _clutter_actor_get_stage_internal (self); + _clutter_actor_traverse (self, CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST, unrealize_actor_before_children_cb, unrealize_actor_after_children_cb, - NULL); + stage); } /*