From afb52438cd22d97b83b8d91ea3976455ba55a9d7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 15 Mar 2006 19:06:24 +0000 Subject: [PATCH] Popdown the list before changing the active iter, otherwise people will be 2006-03-15 Matthias Clasen * gtk/gtkcombobox.c (gtk_combo_box_list_button_released) (gtk_combo_box_list_key_press): Popdown the list before changing the active iter, otherwise people will be surprised by the grabs that are still in place when their ::changed handler runs. --- ChangeLog | 8 ++++++++ ChangeLog.pre-2-10 | 8 ++++++++ gtk/gtkcombobox.c | 12 +++++++----- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4700f7d036..06a0c1c01d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-03-15 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released) + (gtk_combo_box_list_key_press): Popdown the list before changing + the active iter, otherwise people will be surprised by the + grabs that are still in place when their ::changed handler + runs. + 2006-03-15 Dom Lachowicz * modules/engines/ms-windows/msw_style.c: Override style->realize/ diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 4700f7d036..06a0c1c01d 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,11 @@ +2006-03-15 Matthias Clasen + + * gtk/gtkcombobox.c (gtk_combo_box_list_button_released) + (gtk_combo_box_list_key_press): Popdown the list before changing + the active iter, otherwise people will be surprised by the + grabs that are still in place when their ::changed handler + runs. + 2006-03-15 Dom Lachowicz * modules/engines/ms-windows/msw_style.c: Override style->realize/ diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index 95a63a3357..c5114274b6 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -3465,11 +3465,11 @@ gtk_combo_box_list_button_released (GtkWidget *widget, gtk_tree_model_get_iter (combo_box->priv->model, &iter, path); gtk_tree_path_free (path); + gtk_combo_box_popdown (combo_box); + if (tree_column_row_is_sensitive (combo_box, &iter)) gtk_combo_box_set_active_iter (combo_box, &iter); - gtk_combo_box_popdown (combo_box); - return TRUE; } @@ -3588,16 +3588,18 @@ gtk_combo_box_list_key_press (GtkWidget *widget, GtkTreeIter iter; GtkTreeModel *model = NULL; + gtk_combo_box_popdown (combo_box); + if (combo_box->priv->model) { - GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (combo_box->priv->tree_view)); + GtkTreeSelection *sel; + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (combo_box->priv->tree_view)); if (gtk_tree_selection_get_selected (sel, &model, &iter)) gtk_combo_box_set_active_iter (combo_box, &iter); } - gtk_combo_box_popdown (combo_box); - return TRUE; }