[gtk/fix-entry-completion: 2/4] Fix change notification for event controllers



commit 9faaa5e8be929393edbd27d8ac38e228b3af43b8
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 22 12:46:12 2020 -0400

    Fix change notification for event controllers
    
    We were adding event controllers at the end, but
    announcing a change at the beginning, in
    gtk_widget_add_controller. Fix that by emitting
    ::items-changed for the position where we actually
    inserted the controller.

 gtk/gtkwidget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 55127a2ed7..2cedb2508f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -11412,7 +11412,7 @@ gtk_widget_add_controller (GtkWidget          *widget,
   g_ptr_array_add (priv->controllers, controller);
 
   if (priv->controller_observer)
-    gtk_list_list_model_item_added_at (priv->controller_observer, 0);
+    gtk_list_list_model_item_added_at (priv->controller_observer, priv->controllers->len - 1);
 }
 
 /**


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