snapd support for xdg-desktop-portal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Also see forum topic https:/
It has been suggested that it would be a good idea to support xdg portals as used by flatpak to facilitate host<->confinement interaction for common use cases such as opening a URI or opening a file.
The advantage is that the wheel doesn't need to get reinvented for snapd as this use case and the way it should work can be exactly the same regardless of the actual distribution/
In particular, from a KDE point of view I think we would be much happier only having to maintain one set of host-level UI helpers for contained applications, so since xdg-desktop-portals are already being used and we already have UI backing for it we'd much rather move ahead with that.
The biggest limitation of snaps we experience right now is that they can't get access to host files. xdg-desktop-portals solves this problem nicely and in addition, adds some cross-desktop dbus API to do common desktop application stuff such as sending a notification.
http://
The way it works is that the confined application needs access to the portal service on the dbus session bus under `org.freedeskto
So, from a snapd POV all it would need to get started is a xdg-desktop-portal interface giving access to org.freedesktop
As a second step the existing code at [1] probably should be revised for flatpakism. I've already seen an execve to `flatpak run` and hardcoded use of flatpak's metadata. These cases seem fairly isolated, so it's more a matter of finding them and adding logic to attempt using snap if/when applicable.
Lastly, file IO needs to be looked at. From a quick look at [1] it seems to rely on a metadata file `.flatpak-info` in `/proc/$pid/root` to get a bunch of data (naturally that probably should grow support for snap metadata). The most relevant date is the "app_id" which in turn is used by the documents system to provision the file access. If all goes well the helper comes back to the contained application with a URI in /run/user/
[1] https:/
[2] https:/
tags: | added: cross-distro |
description: | updated |
description: | updated |
Thanks for bringing this up!
As this is more a architectural thing rather than a bug it would be great if you can bring this over at https:/ /forum. snapcraft. io/ so we can discuss it with a wider audience of developers and users. Can you create a topic there for this?