Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portal-impl: Use fallback portals for Settings as well #1358

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

liskin
Copy link

@liskin liskin commented May 10, 2024

Since 1.18.2, we have a hardcoded fallback to xdg-desktop-portal-gtk as a last resort if no other portal is defined by a configuration file. This fallback mechanism, however, isn't implemented for the org.freedesktop.impl.portal.Settings interface.

The consequence is that everything seems to work just fine, but user preferences like color scheme are ignored in applications that use the portal API to retrieve them (not just flatpak apps, also libadwaita apps). That comes as a surprise to users; and since the portal stuff otherwise works fine, it's not entirely straightforward to figure out that configuring portal.conf would fix it.

I believe that if find_portal_implementation implements fallbacks, so should find_all_portal_implementations, for consistency and to avoid surprises.

The fallback logic this commit implements closely resembles the logic in find_portal_implementation: we don't look for fallbacks if there is a portal configured in portals.conf (or if portals.conf explicitly says there should be none), and we only use the x-d-p-gtk as a last resort if we haven't found any impl(s) using the legacy UseIn key.

(The above should be a self-contained description but there's some additional thoughts at #1199 (comment))

Fixes: d18c563 ("portal-impl: Hard-code x-d-p-gtk as a last-resort fallback")
Related: #1102

Since 1.18.2, we have a hardcoded fallback to xdg-desktop-portal-gtk as
a last resort if no other portal is defined by a configuration file.
This fallback mechanism, however, isn't implemented for the
org.freedesktop.impl.portal.Settings interface.

The consequence is that everything seems to work just fine, but user
preferences like color scheme are ignored in applications that use the
portal API to retrieve them (not just flatpak apps, also libadwaita
apps). That comes as a surprise to users; and since the portal stuff
otherwise works fine, it's not entirely straightforward to figure out
that configuring portal.conf would fix it.

I believe that if find_portal_implementation implements fallbacks, so
should find_all_portal_implementations, for consistency and to avoid
surprises.

The fallback logic this commit implements closely resembles the logic in
find_portal_implementation: we don't look for fallbacks if there is a
portal configured in portals.conf (or if portals.conf explicitly says
there should be none), and we only use the x-d-p-gtk as a last resort if
we haven't found any impl(s) using the legacy UseIn key.

(The above should be a self-contained description but there's some
additional thoughts at
flatpak#1199 (comment))

Fixes: d18c563 ("portal-impl: Hard-code x-d-p-gtk as a last-resort fallback")
Related: flatpak#1102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

None yet

1 participant