I've always wondered why file picker has to be so tightly integrated into GUI toolkit. Separate program outputting the selected path(s) sounds like much nicer design, and makes it easier to implement alternative file pickers.
https://flatpak.github.io/xdg-desktop-portal/portal-docs.htm...
>The FileChooser portal allows sandboxed applications to ask the user for access to files outside the sandbox. The portal backend will present the user with a file chooser dialog.
In addition it being a dbus api for communicating outside a sandbox