-
-
Notifications
You must be signed in to change notification settings - Fork 183
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: Hard-code x-d-p-gtk as a last-resort fallback #1199
Conversation
94cf7de
to
6ba3798
Compare
x-d-p-gtk has historically been used as the portal implementation of last resort, and in particular, users of assemble-it-yourself desktop environments or otherwise-unsupported desktop environments have tended to rely on it for basic functionality, particularly now that its GNOME-specific parts have been removed. We don't want to install a /usr/share/x-d-p/portals.conf that makes it the fallback (as proposed in xdg-desktop-portal#1192) because that would be higher-precedence than the fallback to the legacy UseIn mechanism. For example, x-d-p-wlr has UseIn=...;Wayfire;... which means that it will be used to provide screenshots and screencasts under Wayfire (even without fixing WayfireWM/wayfire#1995), but installing a /usr/share/x-d-p/portals.conf with only default=gtk would defeat that. Instead, search for x-d-p-gtk as a lower precedence than the legacy UseIn mechanism. This means that (for example) users of Wayfire will get screenshots from x-d-p-wlr and file choosers from x-d-p-gtk unless configured otherwise, while users of environments with no more appropriate portal configuration at all (for example fvwm) will get x-d-p-gtk. This change was previously a Debian-specific patch with a slightly different warning. Resolves: flatpak#1102 Signed-off-by: Simon McVittie <[email protected]>
If we emit this same warning from more than one place, we'll still only want to emit it once per run. Signed-off-by: Simon McVittie <[email protected]>
6ba3798
to
5fb6956
Compare
v2:
|
Until a build of the xdg-desktop-portal including the commit from flatpak/xdg-desktop-portal#1199 is available, a portal config is necessary for desktop portals to work in flatpaks and snaps.
This only handles interfaces that use The consequence is that users of these lightweight desktop environments aren't for example able to override Any chance the fallback can be extended to |
Without this, xdg-desktop-portal-gtk isn't used to provide org.freedesktop.impl.portal.Settings, and therefore libadwaita apps ignore gsettings/dconf (such as preferred color-scheme). See flatpak/xdg-desktop-portal#1199, flatpak/xdg-desktop-portal#1102, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050981
Please open a separate issue rather than replying to a closed pull request.
If there is a reasonable way to describe the desired fallback, and it's implementable, then I think that would make sense. Perhaps you could open a pull request?
If either the desktop environment or an individual user wants to provide a |
I think there are two things that could be considered reasonable fallbacks for Please bear in mind, though, that these last-resort fallbacks are a last resort, and if you want full control, there are better ways to achieve that control (like having your minimal desktop environment announce a name for itself and select one or more suitable Settings backends, similar to what was done in the Debian packaging for dwm). |
I'll see what I can do (tomorrow-ish) 🙂
Oh, this is helpful. Gives me some thoughts to start with. I've also discovered a couple other related issues and pull requests discussing this, and I think the sentiment there was that "every installed portal backend that implements Settings" isn't desirable because x-d-p-gnome misbehaves when not running in an actual GNOME session. So I'm leaning towards making
As a user, I understand that and I obviously created a local As a maintainer of a lightweight window manager that happens to work (and be used) in multiple desktop environments, I'm not really in a position to ship a I mean, if the whole fallback mechanism wasn't there, I'd notice pretty quickly that I need a Anyway, PR tomorrow-ish. |
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
(apologies for adding another comment to a closed PR, this is the last one now that we have a PR 😃) |
x-d-p-gtk has historically been used as the portal implementation of last resort, and in particular, users of assemble-it-yourself desktop environments or otherwise-unsupported desktop environments have tended to rely on it for basic functionality, particularly now that its GNOME-specific parts have been removed.
We don't want to install a /usr/share/x-d-p/portals.conf that makes it the fallback (as proposed in xdg-desktop-portal#1192) because that would be higher-precedence than the fallback to the legacy UseIn mechanism. For example, x-d-p-wlr has UseIn=...;Wayfire;... which means that it will be used to provide screenshots and screencasts under Wayfire (even without fixing WayfireWM/wayfire#1995), but installing a /usr/share/x-d-p/portals.conf with only default=gtk would defeat that.
Instead, search for x-d-p-gtk as a lower precedence than the legacy UseIn mechanism. This means that (for example) users of Wayfire will get screenshots from x-d-p-wlr and file choosers from x-d-p-gtk unless configured otherwise, while users of environments with no more appropriate portal configuration at all (for example fvwm) will get x-d-p-gtk.
This change was previously a Debian-specific patch with a slightly different warning.
Resolves: #1102
Alternative to #1192 and the unfinished #1103.