summaryrefslogtreecommitdiff
path: root/gtk/gtkcombobox.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-03-15 19:00:59 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-03-15 19:00:59 +0000
commit097e3b0b1fd7d34887df3f03e2915a408a9c8f5b (patch)
treea965353fe68579328534b33d1a2715614987a7a6 /gtk/gtkcombobox.c
parent791d0b405b6ca11e77ca031cd3c7775b0bc0996f (diff)
downloadgtk+-097e3b0b1fd7d34887df3f03e2915a408a9c8f5b.tar.gz
Popdown the list before changing the active iter, otherwise people will be
2006-03-15 Matthias Clasen <mclasen@redhat.com> * 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.
Diffstat (limited to 'gtk/gtkcombobox.c')
-rw-r--r--gtk/gtkcombobox.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 44575179b3..196f493462 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -3577,11 +3577,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;
}
@@ -3685,12 +3685,12 @@ gtk_combo_box_list_key_press (GtkWidget *widget,
((event->keyval == GDK_Up || event->keyval == GDK_KP_Up) &&
state == GDK_MOD1_MASK))
{
+ gtk_combo_box_popdown (combo_box);
+
/* reset active item -- this is incredibly lame and ugly */
if (gtk_combo_box_get_active_iter (combo_box, &iter))
gtk_combo_box_set_active_iter (combo_box, &iter);
- gtk_combo_box_popdown (combo_box);
-
return TRUE;
}
@@ -3702,13 +3702,15 @@ gtk_combo_box_list_key_press (GtkWidget *widget,
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));
+
+ gtk_combo_box_popdown (combo_box);
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;
}