-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Make the search order for portals.conf consistent with mimeapps.list #1082
Conversation
Previously, we would search for a user-specific portals.conf as highest precedence, and then iterate through desktop environments, searching for a user-specific desktop-specific file followed by a system-wide desktop-specific file. Now, the precedence order is consistently that directories are most important, we only pay attention to desktop environments within a single directory, and desktop-specific configuration is always higher-precedence than generic within the same directory. Previously, desktop environments and OS vendors had to install their per-desktop configuration into /etc, contradicting the general design principle of putting defaults in /usr and reserving /etc for sysadmin overrides. Now, we search both /etc and /usr/share (with typical environment variables and build-time settings). Previously, we didn't fully follow the XDG Base Directory specification when looking up per-user configuration; now we do. This is potentially significant for users who have more than one per-user directory, for example a machine-specific directory within a home directory shared between machines. Update documentation accordingly. Resolves: flatpak#1081 Signed-off-by: Simon McVittie <[email protected]>
const char **desktops; | ||
const char *portal_dir; | ||
|
||
desktops = get_current_lowercase_desktops (); | ||
|
||
/* We need to override this in the tests */ | ||
portal_dir = g_getenv ("XDG_DESKTOP_PORTAL_DIR"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this as an intentionally undocumented implementation detail, since it's only there for the tests as far as I can see.
/* ${datadir}/xdg-desktop-portal/(DESKTOP-)portals.conf */ | ||
if (load_config_directory (DATADIR "/" XDP_SUBDIR, desktops, opt_verbose)) | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice this is redundant with XDG_DATA_DIRS
but I thought we should probably search it anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, it works. Thanks Simon, this is looking excellent
It doesn't need to be immediately, but I'd like to get a 1.17.1 out with this change at some point, so that when we start asking desktop environment maintainers (upstream or downstream) to install their own |
Previously, we would search for a user-specific portals.conf as highest precedence, and then iterate through desktop environments, searching for a user-specific desktop-specific file followed by a system-wide desktop-specific file. Now, the precedence order is consistently that directories are most important, we only pay attention to desktop environments within a single directory, and desktop-specific configuration is always higher-precedence than generic within the same directory.
Previously, desktop environments and OS vendors had to install their per-desktop configuration into /etc, contradicting the general design principle of putting defaults in /usr and reserving /etc for sysadmin overrides. Now, we search both /etc and /usr/share (with typical environment variables and build-time settings).
Previously, we didn't fully follow the XDG Base Directory specification when looking up per-user configuration; now we do. This is potentially significant for users who have more than one per-user directory, for example a machine-specific directory within a home directory shared between machines.
Update documentation accordingly.
Resolves: #1081