Hi…
I created a Snap for a Desktop application running with Qt 5.12.1.
I cannot find what’s missing to let DekstopServices::openUrl work.
Here is the staging end plugs of my yaml:
What happens when you try to open a URL? Can you snap install snappy-debug and then snappy-debug.security scanlog in a terminal before launching your application. Perhaps some output will give us a clue?
Oh! They’ve adopted the freedesktop portal spec? That’s interesting. We have a https://snapcraft.io/portal-test snap (whose snapcraft.yaml can be found on github).
This error indicates your app is trying to access the desktop portal, probably to call the OpenURI method. For this to work, there needs to be a xdg-desktop-portal program running as part of your user session. When your snap applcation has to use the desktop plug, it will be allowed to access the interface of the desktop portal.
In your case, I think the problem is that the portal is not running, and could not have been started by dbus activation. Maybe looking at the user journal could help, see journalctl --user could help. Also check ps -ef|grep xdg-desktop.
IIRC, some frameworks implement a fallback mechanism that calls xdg-open. Perhaps Qt does not.
Uhm… this sounds like “a lot of additional stuff to do” that I really don’t want to do…
I probably have better time to replace QDesktopServices::openUrl with os::system(“xdg-open url”)
I wonder if we could teach userd to handle this name in case there is no real document portal around. I worry that people will end up patching their snaps because one of the main frameworks did something without a good fallback.