[gtk/wip/otte/for-master: 1/2] dropdown: emit notify for selected from the changed callback



commit 45167d5c0d3e7cc2aecccd6b15f2c3202e1b1586
Author: Benjamin Otte <otte redhat com>
Date:   Sun Jun 21 02:17:47 2020 +0200

    dropdown: emit notify for selected from the changed callback
    
    Otherwise we don't emit it when the selection itself changes it - for
    exaple because the model changed.

 gtk/gtkdropdown.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkdropdown.c b/gtk/gtkdropdown.c
index a95775eab6..ef151e7203 100644
--- a/gtk/gtkdropdown.c
+++ b/gtk/gtkdropdown.c
@@ -216,6 +216,9 @@ selection_changed (GtkSingleSelection *selection,
   if (GTK_IS_STRING_FILTER (filter))
     gtk_string_filter_set_search (GTK_STRING_FILTER (filter), "");
   gtk_single_selection_set_selected (GTK_SINGLE_SELECTION (self->popup_selection), selected);
+
+  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SELECTED]);
+  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SELECTED_ITEM]);
 }
 
 static void
@@ -809,9 +812,6 @@ gtk_drop_down_set_selected (GtkDropDown *self,
     return;
 
   gtk_single_selection_set_selected (GTK_SINGLE_SELECTION (self->selection), position);
-
-  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SELECTED]);
-  g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_SELECTED_ITEM]);
 }
 
 /**


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