Repository navigation
Conversation
dataDirectories() hardcoded /usr/local/share and /usr/share, so the launcher, the switcher and every other registry user missed the directories Flatpak exports its applications to (/var/lib/flatpak and ~/.local/share/flatpak). Read the environment as the XDG base directory spec describes, with the same defaults when it is unset or empty.
…ing paths configHome(), cacheHome(), stateHome() and runtimeDirectory() hardcoded the per-user defaults and configDirectories() hardcoded /etc/xdg, so a user or deployment that sets XDG_CONFIG_HOME, XDG_CACHE_HOME, XDG_STATE_HOME, XDG_RUNTIME_DIR or XDG_CONFIG_DIRS gets a split: Qt applications follow the variables, Cutefish's own do not. Read every variable when it is set and non-empty, keep the previous defaults as fallback, and parse the two directory lists with the same rules as dataDirectories(): empty entries drop out, the rest keep their order, duplicates collapse.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
base::pathshardcoded every directory instead of reading the environment:dataHome()->~/.local/share,dataDirectories()->/usr/local/share:/usr/shareconfigHome()->~/.config,configDirectories()->/etc/xdgcacheHome()->~/.cache,stateHome()->~/.local/stateruntimeDirectory()->/run/user/<uid>Two visible consequences:
the task manager — cannot see applications installed anywhere else. On
distributions using Flatpak, every
.desktopfile lives outside thehardcoded data directories (
/var/lib/flatpak/exports/share,~/.local/share/flatpak/exports/share), so Flatpak applications never showup in the launcher.
XDG_CONFIG_HOME,XDG_CACHE_HOME,XDG_STATE_HOME,XDG_RUNTIME_DIR,XDG_CONFIG_DIRSorXDG_DATA_DIRSgets a split desktop: Qt applications follow the variables, Cutefish's own
do not.
Fix
Read each variable when it is set and non-empty and keep the previous defaults
as the fallback, as the XDG base directory specification describes. The two directory
lists are parsed with shared rules: empty entries drop out, the remaining
entries keep their order, duplicates collapse.
Testing
Fedora 44:
XDG_DATA_DIRSunset/empty the directories are exactly the previousdefaults;
XDG_DATA_DIRS=/d1::/d2the registry scans/d1and/d2(empty entryskipped, duplicates collapsed);
/etc/profile.d/flatpak.shin place (scriptk1d/cutefish-core#52), the launcher lists Flatpak
applications that were missing before.