treeview: Do not focus a path on model change

Instead, focus nothing and wait until we get focus before doing so. This
restores previous behaviour but still emits proper cursor-changed
events.

Fixes a bunch of bugs in the filechooser which populates the treeview
asynchronously.

https://bugzilla.gnome.org/show_bug.cgi?id=613728
This commit is contained in:
Benjamin Otte 2012-01-12 19:34:45 +01:00
parent feb1f8de1c
commit 133179fd25

View File

@ -11462,19 +11462,11 @@ gtk_tree_view_set_model (GtkTreeView *tree_view,
_gtk_tree_view_accessible_add (tree_view, tree_view->priv->tree, NULL);
}
if (search_first_focusable_path (tree_view, &path, TRUE, NULL, NULL))
{
gtk_tree_view_real_set_cursor (tree_view, path, CLEAR_AND_SELECT | CURSOR_INVALID);
gtk_tree_path_free (path);
}
else
gtk_tree_view_real_set_cursor (tree_view, NULL, CURSOR_INVALID);
/* FIXME: do I need to do this? gtk_tree_view_create_buttons (tree_view); */
install_presize_handler (tree_view);
}
else
gtk_tree_view_real_set_cursor (tree_view, NULL, CURSOR_INVALID);
gtk_tree_view_real_set_cursor (tree_view, NULL, CURSOR_INVALID);
g_object_notify (G_OBJECT (tree_view), "model");