> Is there any option to do this via portals - ie can evince use
> org.freedesktop.portal.OpenURI to open the URI? Would then this
> allow to avoid going via xdg-open?
Evince is using g_app_info_launch_default_for_uri(), which can use the portal interface:
However, it only does this as a fallback if no desktop file supports the URI. This is intended to allow a confined app to handle some file types within the sandbox before falling back to portals for everything else.
In the case of Evince running on the host system and seeing all the desktop files in /usr/share/applications and other locations, it likely won't ever call the portal API.
It'd be possible to code in explicit portal API calls, but it isn't something that Evince packaged as a flatpak or snap would need. So it might end up as a distro patch we'd be on the hook to maintain forever.
> Is there any option to do this via portals - ie can evince use .portal. OpenURI to open the URI? Would then this
> org.freedesktop
> allow to avoid going via xdg-open?
Evince is using g_app_info_ launch_ default_ for_uri( ), which can use the portal interface:
https:/ /gitlab. gnome.org/ GNOME/evince/ -/blob/ main/shell/ ev-window. c#L6775- 6778
However, it only does this as a fallback if no desktop file supports the URI. This is intended to allow a confined app to handle some file types within the sandbox before falling back to portals for everything else.
In the case of Evince running on the host system and seeing all the desktop files in /usr/share/ applications and other locations, it likely won't ever call the portal API.
It'd be possible to code in explicit portal API calls, but it isn't something that Evince packaged as a flatpak or snap would need. So it might end up as a distro patch we'd be on the hook to maintain forever.