From 455de5d6d392d838e19569c3f78d1466d17a6dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 8 Jun 2020 15:11:42 +0200 Subject: [PATCH] clutter/align-constraint: Listen to queue-relayout signal of source Just like the ClutterBindConstraint, the ClutterAlignConstraint should listen to "queue-relayout" of its source actor, not "notify::allocation". That's because the latter will queue a relayout during an allocation cycle and might cause relayout loops. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1296 --- clutter/clutter/clutter-align-constraint.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/clutter/clutter/clutter-align-constraint.c b/clutter/clutter/clutter-align-constraint.c index ed10ece2e..2da101961 100644 --- a/clutter/clutter/clutter-align-constraint.c +++ b/clutter/clutter/clutter-align-constraint.c @@ -84,12 +84,11 @@ G_DEFINE_TYPE (ClutterAlignConstraint, CLUTTER_TYPE_CONSTRAINT); static void -source_position_changed (ClutterActor *actor, - GParamSpec *pspec, - ClutterAlignConstraint *align) +source_queue_relayout (ClutterActor *actor, + ClutterAlignConstraint *align) { if (align->actor != NULL) - clutter_actor_queue_relayout (align->actor); + _clutter_actor_queue_only_relayout (align->actor); } static void @@ -186,7 +185,7 @@ clutter_align_constraint_dispose (GObject *gobject) G_CALLBACK (source_destroyed), align); g_signal_handlers_disconnect_by_func (align->source, - G_CALLBACK (source_position_changed), + G_CALLBACK (source_queue_relayout), align); align->source = NULL; } @@ -402,15 +401,15 @@ clutter_align_constraint_set_source (ClutterAlignConstraint *align, G_CALLBACK (source_destroyed), align); g_signal_handlers_disconnect_by_func (old_source, - G_CALLBACK (source_position_changed), + G_CALLBACK (source_queue_relayout), align); } align->source = source; if (align->source != NULL) { - g_signal_connect (align->source, "notify::allocation", - G_CALLBACK (source_position_changed), + g_signal_connect (align->source, "queue-relayout", + G_CALLBACK (source_queue_relayout), align); g_signal_connect (align->source, "destroy", G_CALLBACK (source_destroyed),