New xdg-desktop-portal available (and what it means for your snaps)

Recently, xdg-desktop-portal 1.8.1 was released, which makes some changes to its handling of snap applications. It is currently available in Ubuntu 21.04 (Hirsute), and will likely be making its way into other distro releases as time goes on.

These are the major changes are:

  1. The method of detecting snap applications has changed, so it should now detect snaps on distributions that do not enable AppArmor (e.g. Fedora). Previously xdg-desktop-portal would have treated snaps as unconfined on those systems.

  2. The org.freedesktop.portal.NetworkMonitor portal API now requires that your snap plug the network-status interface. This will likely affect your app if you’re using GLib’s GNetworkMonitor API (or something built on top of it) to detect whether the system is connected to the Internet. Adding this plug should not cause any problems with your snap passing automated review.

  3. The xdg-document-portal daemon now knows about some host system paths a snap will be able to read directly, and will not proxy them through the $XDG_RUNTIME_DIR/doc FUSE file system. This will be most noticeable in snaps that plug the home interface and use the portal file choosers: the app should now see real file paths when the user tries to open files in their home directory.

I think (2) is the only one likely to trip up existing snaps. The others should just improve the experience for people using your snaps.