From 4e724aed46cd7ad0ad7718b584a0f1691b12a09f Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 12 Oct 2010 14:09:47 +0100 Subject: [PATCH] bind-constraint: Use ::queue-relayout Instead of using the allocation-changed signal, use the queue-relayout signal on the source to queue a relayout on the actor to which the BindConstraint has been attached to. The ::allocation-changed signal is not always enough, given that a BindConstraint can use the position as well as the size of an actor to drive the allocation of another; in this regard, it's much similar to a ClutterClone, which requires a notification on every change, even potential, and not just real ones, given the short-circuiting done inside ClutterActor. --- clutter/clutter-bind-constraint.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/clutter/clutter-bind-constraint.c b/clutter/clutter-bind-constraint.c index f68cbaa07..1a238a201 100644 --- a/clutter/clutter-bind-constraint.c +++ b/clutter/clutter-bind-constraint.c @@ -130,10 +130,8 @@ G_DEFINE_TYPE (ClutterBindConstraint, CLUTTER_TYPE_CONSTRAINT); static void -source_allocation_changed (ClutterActor *source, - const ClutterActorBox *allocation, - ClutterAllocationFlags flags, - ClutterBindConstraint *bind) +source_queue_relayout (ClutterActor *source, + ClutterBindConstraint *bind) { if (bind->actor != NULL) clutter_actor_queue_relayout (bind->actor); @@ -392,15 +390,15 @@ clutter_bind_constraint_set_source (ClutterBindConstraint *constraint, G_CALLBACK (source_destroyed), constraint); g_signal_handlers_disconnect_by_func (old_source, - G_CALLBACK (source_allocation_changed), + G_CALLBACK (source_queue_relayout), constraint); } constraint->source = source; if (constraint->source != NULL) { - g_signal_connect (constraint->source, "allocation-changed", - G_CALLBACK (source_allocation_changed), + g_signal_connect (constraint->source, "queue-relayout", + G_CALLBACK (source_queue_relayout), constraint); g_signal_connect (constraint->source, "destroy", G_CALLBACK (source_destroyed),