From 5c5dcd58b53202003c661cf6c5cf27d2eb9161e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Fri, 19 Jun 2020 12:45:18 +0200 Subject: [PATCH] bind-constraint: Don't update preferred size if source contains actor The ClutterBindConstraint will change the preferred size an actor reports so it returns the same size as the source actor in some cases. This behavior was introduced recently with 4f8e518d. This can lead to infinite loops in case the source actor is a parent of the actor the BindConstraint is attached to, that's because calling get_preferred_size() on the source will recursively call get_preferred_size() on the actor again. So to avoid those loops, check if the source is a parent of the actor we're attached to and don't update the preferred size in that case. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1282 --- clutter/clutter/clutter-bind-constraint.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clutter/clutter/clutter-bind-constraint.c b/clutter/clutter/clutter-bind-constraint.c index 11eb5110e..0f51600e0 100644 --- a/clutter/clutter/clutter-bind-constraint.c +++ b/clutter/clutter/clutter-bind-constraint.c @@ -165,6 +165,9 @@ clutter_bind_constraint_update_preferred_size (ClutterConstraint *constraint, bind->coordinate == CLUTTER_BIND_ALL)) return; + if (clutter_actor_contains (bind->source, actor)) + return; + switch (direction) { case CLUTTER_ORIENTATION_HORIZONTAL: