Skip to content

Stop advertising system icon roots as the tray icon theme path - #413

Merged
devmobasa merged 1 commit into
mainfrom
fix/412-redundant-icon-theme-path
Oct 16, 2026
Merged

devmobasa merged 1 commit into
mainfrom
fix/412-redundant-icon-theme-path

Conversation

@devmobasa

@devmobasa devmobasa commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Wayscriber's tray item advertised <prefix>/share/icons as its IconThemePath, so an AUR or other /usr install reported /usr/share/icons. Tray hosts already search that directory. Noctalia indexes the advertised path with a recursive walk on its render thread and repeats the walk for every new tray widget, so each tray drawer open walks every installed icon theme (noctalia-dev/noctalia#4338; a fix is in progress in noctalia-dev/noctalia#4341). This change stops Wayscriber from triggering it.

  • The installed path is left out when it is the icons directory of a data directory that a spec-following host searches: XDG_DATA_HOME and XDG_DATA_DIRS, with the base directory spec defaults and with relative values ignored. Paths are compared after resolving symlinks. /usr, /usr/local, and ~/.local installs advertise nothing. Custom prefixes such as /opt/wayscriber or a Nix store path still advertise their own icons, which fix(tray): harden COSMIC icon fallback #160 added for those installs.
  • The installed path is advertised only while the tray names its symbolic icon. Colored pixmaps need no theme path.
  • WAYSCRIBER_ICON_THEME_PATH still overrides the advertised path, and an empty value advertises none. docs/CONFIG.md now documents the variable and this behavior.

The path resolution moves out of src/daemon/tray/ksni.rs into src/daemon/tray/icon_theme_path.rs. The new paths::searched_data_dirs() reads the XDG data directories.

Validation:

  • Formatting and git diff --check pass.
  • Workspace Clippy with all targets and -D warnings stops at an existing fetch_update deprecation in src/runtime_ui_state/controller/construction.rs, which is unchanged on main. With only that lint allowed, it passes with both all features and no default features.
  • Workspace tests pass with --test-threads=1 for both all features and no default features. New tests cover a system install withheld directly and through a symlinked data directory, a custom prefix that is still advertised, and the XDG defaults, including a relative XDG_DATA_HOME.
  • The C# repository checks pass.

An end-to-end check with Noctalia 5.3.0 on a headless Sway session showed the stall on every tray drawer open with the previous build installed in /usr/bin, and no stall with this branch. The icon still showed through Noctalia's normal theme lookup. The previous build with WAYSCRIBER_ICON_THEME_PATH set to an empty value gave the same result as this branch. The first open after a cold boot and niri itself were not tested.

Refs #412

The tray advertised <prefix>/share/icons as its IconThemePath, so a
package installed under /usr reported /usr/share/icons. Tray hosts
already search that directory, and some index the advertised path
recursively: Noctalia walks every installed icon theme each time its
tray drawer opens (noctalia-dev/noctalia#4338).

- Leave the installed path out when it is the icons directory of a data
  directory a spec-following host searches: the XDG data home and the
  system data directories, with the spec defaults and with relative
  values ignored. Custom prefixes such as /opt and Nix store paths keep
  advertising their own icons.
- Advertise the installed path only while the tray names its symbolic
  icon. Colored pixmaps need no theme path.
- WAYSCRIBER_ICON_THEME_PATH still overrides the path, and an empty
  value advertises none. docs/CONFIG.md now documents both.

Refs #412
@devmobasa
devmobasa merged commit 723436c into main Oct 16, 2026
3 checks passed
@devmobasa
devmobasa deleted the fix/412-redundant-icon-theme-path branch October 17, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant