From b295f552ee5e236cf3bb0777b078fc14c80a06d2 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 4 Dec 2002 18:07:08 +0000 Subject: [PATCH] Add back the monitoring of the selection when the combo isn't popped down; Wed Dec 4 12:44:50 2002 Owen Taylor * gtk/gtkcombo.c (gtk_combo_selection_changed): Add back the monitoring of the selection when the combo isn't popped down; apparently people depended upon the side-effect where gtk_combo_set_popdown_strings() would wipe out the contents of the list when browse-mode autoselected the first item in the list. (#100347) --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-2 | 9 +++++++++ ChangeLog.pre-2-4 | 9 +++++++++ ChangeLog.pre-2-6 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtkcombo.c | 13 +++++++++++++ 7 files changed, 67 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5867638ce6..210f4ad9a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Wed Dec 4 12:44:50 2002 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_selection_changed): Add + back the monitoring of the selection when the combo + isn't popped down; apparently people depended upon + the side-effect where gtk_combo_set_popdown_strings() + would wipe out the contents of the list when browse-mode + autoselected the first item in the list. (#100347) + Tue Dec 3 17:47:24 2002 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 5867638ce6..210f4ad9a1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +Wed Dec 4 12:44:50 2002 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_selection_changed): Add + back the monitoring of the selection when the combo + isn't popped down; apparently people depended upon + the side-effect where gtk_combo_set_popdown_strings() + would wipe out the contents of the list when browse-mode + autoselected the first item in the list. (#100347) + Tue Dec 3 17:47:24 2002 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 5867638ce6..210f4ad9a1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,12 @@ +Wed Dec 4 12:44:50 2002 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_selection_changed): Add + back the monitoring of the selection when the combo + isn't popped down; apparently people depended upon + the side-effect where gtk_combo_set_popdown_strings() + would wipe out the contents of the list when browse-mode + autoselected the first item in the list. (#100347) + Tue Dec 3 17:47:24 2002 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 5867638ce6..210f4ad9a1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +Wed Dec 4 12:44:50 2002 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_selection_changed): Add + back the monitoring of the selection when the combo + isn't popped down; apparently people depended upon + the side-effect where gtk_combo_set_popdown_strings() + would wipe out the contents of the list when browse-mode + autoselected the first item in the list. (#100347) + Tue Dec 3 17:47:24 2002 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 5867638ce6..210f4ad9a1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +Wed Dec 4 12:44:50 2002 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_selection_changed): Add + back the monitoring of the selection when the combo + isn't popped down; apparently people depended upon + the side-effect where gtk_combo_set_popdown_strings() + would wipe out the contents of the list when browse-mode + autoselected the first item in the list. (#100347) + Tue Dec 3 17:47:24 2002 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 5867638ce6..210f4ad9a1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +Wed Dec 4 12:44:50 2002 Owen Taylor + + * gtk/gtkcombo.c (gtk_combo_selection_changed): Add + back the monitoring of the selection when the combo + isn't popped down; apparently people depended upon + the side-effect where gtk_combo_set_popdown_strings() + would wipe out the contents of the list when browse-mode + autoselected the first item in the list. (#100347) + Tue Dec 3 17:47:24 2002 Owen Taylor * gdk/x11/gdkgeometry-x11.c (gdk_window_guffaw_scroll): Fix wrong diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c index ba368797cd..35734d70f1 100644 --- a/gtk/gtkcombo.c +++ b/gtk/gtkcombo.c @@ -671,6 +671,7 @@ gtk_combo_update_entry (GtkCombo * combo) GtkList *list = GTK_LIST (combo->list); char *text; + g_signal_handler_block (list, combo->list_change_id); if (list->selection) { text = gtk_combo_func (GTK_LIST_ITEM (list->selection->data)); @@ -678,6 +679,15 @@ gtk_combo_update_entry (GtkCombo * combo) text = ""; gtk_entry_set_text (GTK_ENTRY (combo->entry), text); } + g_signal_handler_unblock (list, combo->list_change_id); +} + +static void +gtk_combo_selection_changed (GtkList *list, + GtkCombo *combo) +{ + if (!GTK_WIDGET_VISIBLE (combo->popwin)) + gtk_combo_update_entry (combo); } static void @@ -956,6 +966,9 @@ gtk_combo_init (GtkCombo * combo) gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (combo->popup))); gtk_widget_show (combo->list); + combo->list_change_id = g_signal_connect (combo->list, "selection_changed", + G_CALLBACK (gtk_combo_selection_changed), combo); + g_signal_connect (combo->popwin, "key_press_event", G_CALLBACK (gtk_combo_list_key_press), combo); g_signal_connect (combo->popwin, "button_press_event",