Skip to content

icons: theme dirs without index.theme in a base dir are skipped, breaking cross-base-dir merging (all Chromium PWA icons invisible) #125

Closed

Description

@YUxiangLuo

Summary

CSystemIconFactory::getThemeDir() skips a <base>/icons/<theme> dir entirely when it has no index.theme. Per the de-facto freedesktop behavior implemented by GTK and Qt, a theme is defined by an index.theme found in any base dir, and icon lookup then searches that theme's Directories across all base dirs ($XDG_DATA_HOME first, then $XDG_DATA_DIRS).

Possibly related: hyprwm/hyprlauncher#132 ("Missing icons on most apps").

Why it matters

Chromium-based browsers (Chrome/Brave/Edge) install PWA icons into ~/.local/share/icons/hicolor/<size>/apps/*.png without ever creating ~/.local/share/icons/hicolor/index.theme. On GTK/Qt this works because /usr/share/icons/hicolor/index.theme defines the theme and the lookup merges base dirs. With hyprtoolkit the entire user-local hicolor copy is skipped, so all browser PWA icons are invisible — this affects hyprlauncher and every hyprtoolkit consumer (e.g. hyprland-dialog).

hicolor is also special-cased by the spec as the always-present fallback theme, which makes skipping it even more surprising.

Reproduction

  1. Install any site as a PWA in Chromium/Chrome/Brave
  2. Observe ~/.local/share/icons/hicolor/128x128/apps/<browser>-<appid>-Default.png exists
  3. Open hyprlauncher → the PWA entry shows no icon
  4. HT_TRACE=1 hyprlauncher logs:
    CSystemIconFactory: skipping theme dir /home/<user>/.local/share/icons/hicolor (no index.theme)

Workaround

Create ~/.local/share/icons/hicolor/index.theme declaring the size dirs present. Verified on hyprlauncher 0.1.6-7 (Arch): after adding it, the trace shows

CSystemIconFactory: parsing inherited theme ["/usr/share/icons/hicolor", "/home/<user>/.local/share/icons/hicolor"]

and all PWA icons appear (merging works correctly once the file exists — the system hicolor is not shadowed).

Suggested direction

When a same-named theme dir in some base dir lacks index.theme, fall back to the Directories list of the same theme found in another base dir (or special-case hicolor as an always-on fallback), matching GTK/Qt merging behavior.

Activity

  1. mariuszste commented on Aug 18, 2026

    @mariuszste

    Also affects icons created by Wine

    Workaround ln -s /usr/share/icons/hicolor/index.theme ~/.local/share/icons/hicolor/index.theme

  2. vaxerski commented on Aug 20, 2026

    @vaxerski
    Member

    wait, isn't the lack of index.theme... invalid?

  3. mariuszste commented on Aug 20, 2026

    @mariuszste

    wait, isn't the lack of index.theme... invalid?

    https://specifications.freedesktop.org/icon-theme/latest/#directory_layout

    In at least one of the theme directories there must be a file called index.theme that describes the theme. The first index.theme found while searching the base directories in order is used. This file describes the general attributes of the theme.

  4. vaxerski commented on Aug 22, 2026

    @vaxerski
    Member

    so where is the index.theme describing hicolor?

  5. YUxiangLuo commented on Aug 22, 2026

    @YUxiangLuo
    Author

    so where is the index.theme describing hicolor?

    sorry, will close it.

  6. mariuszste commented on Aug 25, 2026

    @mariuszste

    so where is the index.theme describing hicolor?

    /usr/share/icons/hicolor/index.theme

    It describes the entire theme. What's in ~/.local/share should be treated as an overlay, first look in there, then in system files.
    The file in /usr satisfies In at least one of the theme directories. That's hwo every other desktop does it as well.

    please re-open @YUxiangLuo

  7. YUxiangLuo commented on Aug 25, 2026

    @YUxiangLuo
    Author

    so where is the index.theme describing hicolor?

    /usr/share/icons/hicolor/index.theme

    It describes the entire theme. What's in ~/.local/share should be treated as an overlay, first look in there, then in system files. The file in /usr satisfies In at least one of the theme directories. That's hwo every other desktop does it as well.

    please re-open @YUxiangLuo

    ok

  8. UncleJ4ck commented on Nov 9, 2026

    @UncleJ4ck
    Contributor

    Confirmed the cause. getThemeDir only keeps a <base>/<theme> dir when that dir has its own index.theme, and parseTheme then added the theme's Directories under that single base. So when chromium writes its PWA icons into ~/.local/share/icons/hicolor/<size>/apps (no index.theme there), that path never made it into the lookup list and the icons came back empty.

    Fix in #157: add each Directories entry under every icon base dir, not just the one holding the index.theme, which is how GTK/Qt resolve it too. Verified by planting an icon under ~/.local/share/icons/hicolor/48x48/apps and logging the lookup paths with and without the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions