Index: gtk/gtkfilechooserdefault.c
===================================================================
--- gtk/gtkfilechooserdefault.c	(revision 19421)
+++ gtk/gtkfilechooserdefault.c	(working copy)
@@ -8212,7 +8212,44 @@
     gtk_widget_grab_focus (impl->browse_files_tree_view);
 }
 
+/* Gives the focus to the browse tree view only if it is visible, and if it was used to select a file*/
 static void
+focus_browse_tree_view_if_location_bar_unchanged (GtkFileChooserDefault *impl)
+{
+  const char *entry_text;
+  gboolean do_focus;
+
+  if ((impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
+       impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
+      && !gtk_expander_get_expanded (GTK_EXPANDER (impl->save_expander)))
+    do_focus = FALSE;
+  /* This fixes one bug that caused #419737
+   * Only refocus if the user actually was browsing the tree.
+   * Otherwise files in the tree may get selected.
+   */
+  else if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
+	     || impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER
+	     || ((impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
+	          || impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
+	         && impl->location_mode == LOCATION_MODE_FILENAME_ENTRY))
+    {
+      g_assert (impl->location_entry != NULL);
+
+      entry_text = gtk_entry_get_text (GTK_ENTRY (impl->location_entry));
+
+      if (impl->browse_files_last_selected_name)
+        do_focus = (compare_utf8_filenames (impl->browse_files_last_selected_name, entry_text) == 0);
+      else
+        do_focus = FALSE;
+    }
+  else
+    do_focus = TRUE;
+
+  if (do_focus)
+    gtk_widget_grab_focus (impl->browse_files_tree_view);
+}
+
+static void
 action_create_folder_cb (GtkFileSystemHandle *handle,
 			 const GtkFilePath   *path,
 			 const GError        *error,
@@ -10310,7 +10347,7 @@
   if (path != NULL)
     {
       change_folder_and_display_error (impl, path, FALSE);
-      focus_browse_tree_view_if_possible (impl);
+      focus_browse_tree_view_if_location_bar_unchanged (impl);
       
       gtk_file_path_free (path);
     }
@@ -10396,7 +10433,7 @@
   if (!error && gtk_file_info_get_is_folder (info))
     {
       change_folder_and_display_error (data->impl, data->path, FALSE);
-      focus_browse_tree_view_if_possible (data->impl);
+      focus_browse_tree_view_if_location_bar_unchanged (data->impl);
     }
   else
     gtk_file_chooser_default_select_path (GTK_FILE_CHOOSER (data->impl),
@@ -11243,7 +11280,7 @@
     g_assert_not_reached ();
 
   shortcuts_activate_iter (impl, &iter);
-  focus_browse_tree_view_if_possible (impl);
+  focus_browse_tree_view_if_location_bar_unchanged (impl);
 }
 
 /* Handler for the "home-folder" keybinding signal */
