xdg-desktop-portal icon indicating copy to clipboard operation
xdg-desktop-portal copied to clipboard

Add SchemeSupported to the OpenURI portal

Open xhorak opened this issue 1 year ago • 5 comments

To check whenever specific scheme is supported by the host.

xhorak avatar Nov 16 '23 17:11 xhorak

I think this change as it is, is a bit incomplete. If an app/client is supposed to call this API, it needs to be added to the org.freedesktop.portal.OpenURI instead, because your addition is what backend implementations (xdp-kde/xdp-gnome) are supposed to implement, but these APIs are not called directly by clients and possibly not even visible outside the sandbox by default. With an additional API, you should also bump a version of the org.freedesktop.portal.OpenURI so clients can check whether the version of xdp that is running on the host supports it. I'm not sure a backend counterpart is needed as you can probably tell the host can handle given scheme using the g_app_* APIs (I'm not an expert in this regard). That would mean that also the implementation of this additional API is missing in this MR.

grulja avatar Jan 16 '24 12:01 grulja

@xhorak also please squash your commits or split it to reasonable parts and remove the merge commit.

grulja avatar Jan 23 '24 08:01 grulja

@matthiasclasen Could you please check this one?

xhorak avatar Jan 31 '24 09:01 xhorak

This needs a rebase.

Also, see https://github.com/flatpak/xdg-desktop-portal/pull/1375. You will have to bump version to 5. Also at the top of the XML file there is a sentence This document describes interface in version 4 which needs to be updated too.

I also wonder whether this shouldn't be more generic, e.g. looking at https://github.com/flatpak/xdg-desktop-portal/pull/1313, this will make OpenURI to handle more than schemes. Maybe something like having URISupported which is probably a terrible name, but just to give you the sense what I mean.

Also, OpenURI gives you an option to install an app that can possible handle the requested scheme if there is none on the system. With your SchemeSupported call, you will end up making Firefox to handle it itself, because you don't get to call the OpenURI. Just mentioning this as something to think about as I don't have a solution to this.

grulja avatar Jun 10 '24 09:06 grulja

Also, maybe this can be permission based? To address @matthiasclasen concerns?

Like, first ask will popup a permission dialog, to ask whether you want to allow given application access to this information, store it for this app (app_id) and have all the following ones without any permission dialog needed in case the permission has been granted already?

That would mean using the generic Access portal for this.

grulja avatar Jun 10 '24 09:06 grulja