[gtk+/gtk-2-24] ComboBox: Don’t let modes disconnect each other



commit 6b4e050e1553c349172f474c22672dce40102c8e
Author: Daniel Boles <dboles src gnome org>
Date:   Fri Oct 6 01:41:37 2017 +0100

    ComboBox: Don’t let modes disconnect each other
    
    …from priv->button. My refactor to g_signal_disconnect_by_data()
    included this widget, when I shouldn’t have as both modes use it.
    In GTK+ 3, this broke opening a CB by keyboard that was in menu mode,
    if it had been in list mode initially (e.g. due to the theme).
    
    Fix by moving to disconnect_by_func() and only removing in each mode’s
    destroy() method the signals that it set on the button in its setup().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788577

 gtk/gtkcombobox.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index d5fe00f..e74cd29 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -3182,7 +3182,15 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
 {
   GtkComboBoxPrivate *priv = combo_box->priv;
 
-  g_signal_handlers_disconnect_by_data (priv->button, combo_box);
+  g_signal_handlers_disconnect_by_func (priv->button,
+                                        gtk_combo_box_button_toggled,
+                                        combo_box);
+  g_signal_handlers_disconnect_by_func (priv->button,
+                                        gtk_combo_box_menu_button_press,
+                                        combo_box);
+  g_signal_handlers_disconnect_by_func (priv->button,
+                                        gtk_combo_box_button_state_changed,
+                                        combo_box);
   g_signal_handlers_disconnect_by_data (priv->popup_widget, combo_box);
 
   /* unparent will remove our latest ref */


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