--- ./gtk/gtktreeview.c.orig	2004-06-25 13:41:21.389546264 +0300
+++ ./gtk/gtktreeview.c	2004-06-25 22:52:45.757957768 +0300
@@ -8007,7 +8007,32 @@
 
   if (cursor_path == NULL)
     {
-      cursor_path = gtk_tree_path_new_first ();
+      /* Consult the selection before defaulting to the first element */
+      GtkTreeSelection *selection;
+      GtkTreeModel     *model;
+      GList            *selected_rows;
+
+      selection = gtk_tree_view_get_selection (tree_view);
+      selected_rows = gtk_tree_selection_get_selected_rows (selection, &model);
+      if (selected_rows)
+        {
+          cursor_path = gtk_tree_path_copy((const GtkTreePath *)
+                                           (selected_rows->data));
+        }
+      else
+        {
+          cursor_path = NULL;
+        }
+      /* Now - free the list according to the instructions in the
+       * gtk_tree_selection_get_selected_rows() documentation
+       * */
+      g_list_foreach (selected_rows, (GFunc)gtk_tree_path_free, NULL);
+      g_list_free (selected_rows);
+      /* If all else fails - default to the first item */
+      if (! cursor_path)
+        {
+          cursor_path = gtk_tree_path_new_first ();
+        }
       gtk_tree_row_reference_free (tree_view->priv->cursor);
       tree_view->priv->cursor = NULL;
 
