Commit 097e3b0b authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen
Browse files

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.
parent 791d0b40
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment