]> Pileus Git - ~andy/gtk/commitdiff
treeview: Do not focus a path on model change
authorBenjamin Otte <otte@redhat.com>
Thu, 12 Jan 2012 18:34:45 +0000 (19:34 +0100)
committerBenjamin Otte <otte@redhat.com>
Thu, 12 Jan 2012 18:37:15 +0000 (19:37 +0100)
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

gtk/gtktreeview.c

index eb3afc8c06798cdaa09ecc70577fba84cb6ab6fa..091dc9017e0c4be04a75cbbf48729c6822207da3 100644 (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");