[gtk+] GtkStack: Avoid a few redundant notify emissions



commit d591341bd13109cfe717c190c9d364362bc0f24f
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jun 6 23:35:53 2014 -0400

    GtkStack: Avoid a few redundant notify emissions
    
    A few of the property setters were missing the
    standard checks.

 gtk/gtkstack.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 692aa2e..70611f4 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -1315,6 +1315,9 @@ gtk_stack_set_transition_duration (GtkStack *stack,
 
   g_return_if_fail (GTK_IS_STACK (stack));
 
+  if (priv->transition_duration == duration)
+    return;
+
   priv->transition_duration = duration;
   g_object_notify_by_pspec (G_OBJECT (stack),
                             stack_props[PROP_TRANSITION_DURATION]);
@@ -1364,6 +1367,9 @@ gtk_stack_set_transition_type (GtkStack              *stack,
 
   g_return_if_fail (GTK_IS_STACK (stack));
 
+  if (priv->transition_type == transition)
+    return;
+
   priv->transition_type = transition;
   g_object_notify_by_pspec (G_OBJECT (stack),
                             stack_props[PROP_TRANSITION_TYPE]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]