--- gedit-3.2.1.orig/gedit/gedit-commands-file.c +++ gedit-3.2.1/gedit/gedit-commands-file.c @@ -36,6 +36,7 @@ #include /* For strlen and strcmp */ +#include #include #include #include @@ -476,7 +477,14 @@ _gedit_cmd_file_open (GtkAction *actio if (default_path == NULL) default_path = _gedit_window_get_default_location (window); - + + /*If default_path is still NULL, we set it to users home directory + *to prevent the file chooser from displaying "Recently Used" as default + *location + */ + if (default_path == NULL) + default_path = g_file_new_for_path (g_get_home_dir()); + if (default_path != NULL) { gchar *uri; @@ -897,8 +905,24 @@ file_save_as (GeditTab *tab, uri); g_free (uri); - g_object_unref (default_path); } + + /*If default_path is NULL, we set it to users home directory + *to prevent the file chooser from displaying "Recently Used" as default + *location + */ + if (default_path == NULL) + { + gchar *uri; + + default_path = g_file_new_for_path (g_get_home_dir()); + uri = g_file_get_uri (default_path); + gtk_file_chooser_set_current_folder_uri (GTK_FILE_CHOOSER (save_dialog), + uri); + + g_free (uri); + } + g_object_unref (default_path); gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER (save_dialog), docname);