summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Dreßler <verdre@v0yd.nl>2020-06-19 12:45:18 +0200
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2020-06-19 14:59:27 +0000
commit5c5dcd58b53202003c661cf6c5cf27d2eb9161e5 (patch)
tree2e01cfc933c6d0015942828273b2848c6d597023
parent6ea0f8facc0c88a56aacb0a70372a2644c687340 (diff)
downloadmutter-5c5dcd58b53202003c661cf6c5cf27d2eb9161e5.tar.gz
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
-rw-r--r--clutter/clutter/clutter-bind-constraint.c3
1 files changed, 3 insertions, 0 deletions
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: