From 50e0ae3cf3a28f3c4f28dd38b9aa28ed2bdaea21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 31 Mar 2020 19:41:33 +0200 Subject: [PATCH] clutter/actor-meta: Warn if an actor modifier is altered mid paint Nothing should ever disable an actor modifier (e.g. effect) during the paint sequence, nor should any actor be set or unset on it. If this would happen, log warnings so that it can be tracked down. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1166 --- clutter/clutter/clutter-actor-meta.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clutter/clutter/clutter-actor-meta.c b/clutter/clutter/clutter-actor-meta.c index eba098584..f90c44e9d 100644 --- a/clutter/clutter/clutter-actor-meta.c +++ b/clutter/clutter/clutter-actor-meta.c @@ -88,6 +88,10 @@ static void clutter_actor_meta_real_set_actor (ClutterActorMeta *meta, ClutterActor *actor) { + g_warn_if_fail (!meta->priv->actor || + !CLUTTER_ACTOR_IN_PAINT (meta->priv->actor)); + g_warn_if_fail (!actor || !CLUTTER_ACTOR_IN_PAINT (actor)); + if (meta->priv->actor == actor) return; @@ -293,6 +297,9 @@ clutter_actor_meta_set_enabled (ClutterActorMeta *meta, { g_return_if_fail (CLUTTER_IS_ACTOR_META (meta)); + g_warn_if_fail (!meta->priv->actor || + !CLUTTER_ACTOR_IN_PAINT (meta->priv->actor)); + is_enabled = !!is_enabled; if (meta->priv->is_enabled == is_enabled)