[gtk] stack: Fix up property notification



commit b8903a4aba32783087ef30280a376307c03ad1ee
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 8 09:03:45 2019 -0500

    stack: Fix up property notification
    
    This was showing up in testsuite failures.

 gtk/gtkstack.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 75bcc69059..338199c319 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -333,8 +333,11 @@ gtk_stack_page_set_property (GObject      *object,
       break;
 
     case CHILD_PROP_NEEDS_ATTENTION:
-      info->needs_attention = g_value_get_boolean (value);
-      g_object_notify_by_pspec (object, pspec);
+      if (info->needs_attention != g_value_get_boolean (value))
+        {
+          info->needs_attention = g_value_get_boolean (value);
+          g_object_notify_by_pspec (object, pspec);
+        }
       break;
 
     default:
@@ -385,7 +388,7 @@ gtk_stack_page_class_init (GtkStackPageClass *class)
                       P_("The index of the child in the parent"),
                       -1, G_MAXINT,
                       0,
-                      GTK_PARAM_READWRITE);
+                      GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   /**
    * GtkStack:needs-attention:
@@ -400,7 +403,7 @@ gtk_stack_page_class_init (GtkStackPageClass *class)
                          P_("Needs Attention"),
                          P_("Whether this page needs attention"),
                          FALSE,
-                         GTK_PARAM_READWRITE);
+                         GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
 
   g_object_class_install_properties (object_class, LAST_CHILD_PROP, stack_child_props);
 }


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