Using the xdg-desktop-portal on GNU/Linux?

The GTK3 default file picker is completely inferior to the Windows and MacOS file selector widgets. However, GTK3 on GNU/Linux allows to use the desktop portal (Such as if the KDE portal is installed) to use the libraries provided by KDE to get a significantly better one.

Since I can only upload one image, here is for reference the KDE portal file chooser:

The default GTK3 one has no thumbnails other than a sidepanel for a single image. This makes it incredibly inconvenient to use if many images exist in a directory.

GTK3 and GTK4, there is an API to allow using the native portals if installed and configured.
From the API, for GTK3 is FileChooserNative. Can I hook into PyGObject API since this uses GTK3 on unix like systems? Or should I instead use the python xdg libraries instead?

I’m not sure how well mixing wxPython with PyGObject would work. You could try, though.

But some news on this front, upstream recently merged GtkFileChooserNative support, see: Use GtkFileChooserNative for wxFileDialog/wxDirDialog when possible by paulcor · Pull Request #25152 · wxWidgets/wxWidgets · GitHub

I’m not sure whether this could be backported to 3.2, though.

I’m very pleased to hear that GtkFileChooserNative was merged, meaning that next official stable release I can compile for debian and use it immediately. :smiley:

It still leaves in the air if Qt6 or GTK4 will be next in line after GTK3, only time will tell.