From f288a279bbaa72fb5e69d2a815b212d51e73ab52 Mon Sep 17 00:00:00 2001 From: j4kuuu Date: Tue, 10 Nov 2026 00:58:14 +0100 Subject: [PATCH] system/icons: search a theme's dirs across all base dirs getThemeDir only kept a base dir that had its own index.theme, and parseTheme added lookup paths only under that base. But a theme's index.theme lives in one base dir while its icon dirs can span all of them (chromium drops PWA icons into ~/.local/share/icons/hicolor//apps with no index.theme there), so those were never searched. Add each Directories entry under every base dir. --- src/system/Icons.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/system/Icons.cpp b/src/system/Icons.cpp index 23e592f6..43d2ee52 100644 --- a/src/system/Icons.cpp +++ b/src/system/Icons.cpp @@ -204,17 +204,22 @@ void CSystemIconFactory::parseTheme(const std::string& themeDir) { directoriesEntry = THEME_DATA->find("\nDirectories ="); if (directoriesEntry != std::string::npos) { - const auto BASE_PATH = std::filesystem::path{themeDir}; + const auto BASE_PATH = std::filesystem::path{themeDir}; + const std::string THEME = BASE_PATH.filename().string(); - size_t directoriesLineEnd = THEME_DATA->find('\n', directoriesEntry + 2); - directoriesEntry = THEME_DATA->find('=', directoriesEntry + 2) + 1; + size_t directoriesLineEnd = THEME_DATA->find('\n', directoriesEntry + 2); + directoriesEntry = THEME_DATA->find('=', directoriesEntry + 2) + 1; std::string directoriesList = THEME_DATA->substr(directoriesEntry, directoriesLineEnd - directoriesEntry); CConstVarList dirs(directoriesList, 0, ',', true); + // the index.theme lives in one base dir, but a theme's icon dirs can be spread across all of + // them: chromium drops PWA icons into ~/.local/share/icons///apps with no + // index.theme there. add each listed dir under every base dir so those are found too. for (const auto& d : dirs) { - m_lookupPaths.emplace_back(BASE_PATH / d); + for (const auto& rawBase : getXDGIconThemeDirs()) + m_lookupPaths.emplace_back(std::filesystem::path{fromDir(rawBase.c_str())} / THEME / std::string{d}); } g_logger->log(HT_LOG_TRACE, "CSystemIconFactory: theme {} has {} dirs", themeDir, dirs.size());