portal-impl: Only return found implementation if it launched #985
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If no portal backend for a given interface is found, a fallback is always tried anyway, despite that fallback not being listed as compatible with the current desktop environment.
Sometimes it's good that a fallback is returned; e.g. the xdg-desktop-portal-gtk file chooser backend is technically usable anywhere, however, some backends might be specifically designed to only work in a specific desktop environment, e.g. xdg-desktop-portal-gnome.
In order to avoid creating portals with non-functional backends, make sure it's possible to create a proxy object for the interface and D-Bus name, and that it launched successfully (i.e. has no name owner after creating the proxy).
Opening this against xdg-desktop-portals-1.16 because hopefully #955 will make this obsolete.
Not sure how this will work on non-systemd systems; it relies on using
g_dbus_proxy_get_name_owner()
being set after D-Bus activation did its thing, which is true for the portals I have managed to test (xdg-desktop-portal-{gnome,gtk,kde})