xdg-open and file:// URI handling

Cosimo Cecchi cosimoc at gnome.org
Thu Apr 7 01:37:06 UTC 2016


On Wed, Apr 6, 2016 at 11:30 AM, Robert McQueen <robert at endlessm.com> wrote:

> Anyway - this class of problem applies to any app with a mime type
> binding, so it is used by xdg-open or GIO file:// URI handling etc. I think
> we would need something like an xdg-app-open which understands/recognises
> file paths in the command line argument, and maps them in to the sandbox
> using the document portal in some kind of transient / one-shot kind of way,
> before handing the transformed path/URI into the app.
>
> Then I guess we need to put that in the .desktop files for those apps
> which use the document portal and care to access local files handed in at
> launch time in this way.
>
> Any thoughts?
>

That's not the only thing that we would need though; a related problem is
when an application wants to launch another one (e.g. through
g_app_info_launch_uris(), or gtk_show_uri()). In that case, I believe GIO
running in the sandbox will not have access to e.g. /usr/share/applications
to enumerate all the apps that are available for the mimetype, and will
fail to launch.
One rather easy solution would be to map the desktop files in the sandbox,
e.g. somewhere under /run/, but I'm not sure if that's what we want.
Another approach would require patching GIO to call out to a "launch app"
portal outside of the sandbox?

Cosimo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/flatpak/attachments/20160406/c3c3d3c7/attachment.html>


More information about the xdg-app mailing list