Background
There has been a rough consensus for a while between nautilus developers, designers, and other members of the community that nautilus should provide a org.freedesktop.impl.portal.FileChooser
backend. Unlike the GTK file chooser implementation, nautilus can provide visual and behavioral consistency with a single codebase, use GNOME platform features (e.g. libadwaita), nautilus features (e.g. starred files) and generally move along with the platform.
However, this has been vaporware up until now. And for good reasons: nautilus first needed to be ported to GTK4 and, even after, the main view components needed refactoring and cleanup. We had enough technical debt, so the “file chooser mode” should not come at the cost of even more technical debt.
Current Status
During the 46 development cycle, the view components underwent a major refactoring meant to, among other things, prepare for the file chooser mode. And the new Network view is being worked on. This means we are at the point in time where the codebase is finally getting ready to introduce a file chooser mode.
The GNOME Foundation is sponsoring me to make it happen during the 47 development cycle, as part of the Sovereign Tech Fund.
Portal Implementation
So, I’m opening this thread to allow technical input from the community.
Currently, xdg-desktop-portal-gnome
uses GtkFileChooserDialog
as the centerpiece of its implementation, enhancing it with portal D-Bus methods handling and external window parenting.
For nautilus to provide a drop-in replacement, it would need to expose something like a NautilusFileChooserDialog
widget class as part of a library. For obvious reasons, maintaining a library API is something I would like to avoid.
Instead, my working hypothesis is we don’t need to have the portal implementation in xdg-desktop-portal-gnome
and can do the whole portal implementation (executable, D-bus method handling, parenting) in the nautilus codebase. I assume installing a nautilus.portal
file and changing gnome-portals.conf
to prefer the nautilus implementation would be enough to make it work.
xdg-desktop-portal-gnome
could probably drop its FileChooser implementation, if we assume nautilus
is available in GNOME, as xdg-desktop-portal-gtk
is already acting as fallback.