From ef8ae7d72f752e10552e254c1ff9e76d19430aac Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 21 Oct 2009 15:16:43 +0100 Subject: [PATCH] behaviour: Notify changes of the :alpha property The set_alpha() setter of ClutterBehaviour is not emitting notifications for the alpha property. --- clutter/clutter-behaviour.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index 42e2a9cd9..b1541acc7 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -575,8 +575,8 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, priv = behave->priv; - if (alpha) - g_object_ref_sink (alpha); + if (priv->alpha == alpha) + return; if (priv->notify_id) { @@ -587,7 +587,7 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, priv->notify_id = 0; } - if (priv->alpha) + if (priv->alpha != NULL) { CLUTTER_NOTE (BEHAVIOUR, "removing previous alpha object"); @@ -595,9 +595,9 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, priv->alpha = NULL; } - if (alpha) + if (alpha != NULL) { - priv->alpha = alpha; + priv->alpha = g_object_ref_sink (alpha); priv->notify_id = g_signal_connect (priv->alpha, "notify::alpha", G_CALLBACK(notify_cb), @@ -606,6 +606,8 @@ clutter_behaviour_set_alpha (ClutterBehaviour *behave, CLUTTER_NOTE (BEHAVIOUR, "setting new alpha object (%p, notify:%d)", priv->alpha, priv->notify_id); } + + g_object_notify (G_OBJECT (behave), "alpha"); } /**