GNOME Bugzilla – Bug 750068
"Recent" shortcut is missing from the left pane in the file chooser
Last modified: 2015-06-09 21:50:15 UTC
When I create a file chooser dialog with GTK_FILE_CHOOSER_ACTION_OPEN it starts up with the right pane displaying recent files. However, there is no shortcut in the left pane to select this location. If the user navigates to a different location there is no way to go back to "Recent" without closing and reopening the file chooser dialog.
What does gsettings get org.gnome.desktop.privacy remember-recent-files say ?
$ gsettings get org.gnome.desktop.privacy remember-recent-files No such schema 'org.gnome.desktop.privacy'
Does gvfs-ls recent:// work ?
$ gvfs-ls recent:// bash: gvfs-ls: command not found (note that this is on Windows, not Linux)
Since you say that the file list _is_ showing recent files (you could probably verify that by opening the location entry with Ctrl-L, and entering 'recent:///'), the only possibility I see is that you have a settings.ini file somewhere that sets gtk-recent-files-enabled to FALSE.
I've pushed a change to prevent the sidebar and the file list from having different opinions about whether recent files should be shown. Maybe that helps in your case.
I applied your changes and now I don't see recent files at all. It just dumps me into the directory that contains the application binaries. How is that an improvement?
By the way, when I press Ctrl-L and type "recent:///" it won't accept the ':' character.
> How is that an improvement? It makes GTK+ internally consistent. > By the way, when I press Ctrl-L and type "recent:///" it won't accept the > ':' character. pretty clearly, there is no support for the recent: scheme in your glib - which makes some sense, since it is implemented in gvfs.
>> How is that an improvement? > > It makes GTK+ internally consistent But now the user experience is degraded. Previously he had access to recent files and now he doesn't.
(In reply to draymond from comment #10) > >> How is that an improvement? > > > > It makes GTK+ internally consistent > > But now the user experience is degraded. Previously he had access to recent > files and now he doesn't. I don't see how that can be if the recent: scheme is not supported.
If you look at the original problem description that is exactly what is happening. The file chooser dialog starts up showing recent files but there is no link to navigate there in the left pane. Remember - this is on Windows. A lot of the stuff you were asking seems Linux oriented.
There's no win32-specific code in GTK+ for handling recent files that I can find. If you can figure out where GTK+ on windows would get recent files info from, by all means, tell me and we'll figure out a way to bring the Recent item in the sidebar back.
The recent file list is coming from the default recent manager. The following code snippet generates the same list of files that I see in the right pane of my file chooser when I first open it: { GtkRecentManager *manager; GList *list; manager = gtk_recent_manager_get_default(); list = gtk_recent_manager_get_items(manager); while (list) { GtkRecentInfo *info = list->data; printf("%s\n", gtk_recent_info_get_display_name(info)); list = list->next; } }
The function recent_scheme_is_supported() in gtkplacessidebar.c seems to be the problem. It queries supported URI schemes which are "file, http, https" on my Windows system. Since "recent" is not present the function returns FALSE. Forcing recent_scheme_is_supported() to return TRUE causes the Recent bookmark to appear and it works as expected.
I think I would like to remove the current code that loads recent files 'manually' in gtkfilechooserwidget.c and instead rely on gvfs support for loading recent files. But in the interim, we can make this work.
FYI, the same problem currently exists on OSX and the hack above resolves it there, too.
Pushed a few changes that should fix this
There seems to be another small issue. When the user selects the Recent bookmark it is displayed correctly in the right pane of the file chooser. However, the bookmark itself is not highlighted. It highlights when you first click it and then the highlighting quickly disappears so that none of the bookmarks are highlighted. None of the other bookmarks exhibit this behavior.
Also, I looked through your latest changes. Am I correct in my understanding that the application must now make a call to set a property before the Recent bookmark appears? How will the application developer know to do this?
No, the property is set by GTK+, no need for applications to get involved, unless they are using the places sidebar themselves - really just nautilus.
1) the Recent bookmark will not appear if should_show_recent() returns false 2) should_show_recent() will return false on Windows and OSX if the new variable "show_recent_set" is false 3) "show_recent_set" will be false unless a call is made to the new function gtk_places_sidebar_set_show_recent() 4) the only place that calls gtk_places_sidebar_set_show_recent() is gtk_places_sidebar_set_property() when called with the new property "PROP_SHOW_RECENT" 5) since "PROP_SHOW_RECENT" is new nobody is currently using it So as I see it, with these changes the Recent bookmark will not appear on Windows or OSX.
show-recent is set in gtkfilechooserwidget.ui where the sidebar is constructed
OK, I ported the changes to 3.16 and tested it on Windows. The Recent bookmark does appear correctly in the sidebar now. Regarding the other issue (highlighting of bookmark not working) I created a new bug: 750663.