Skip to content

[BUG] Tray drawer freezes shell on every open when an item's IconThemePath is a large directory #412

Closed

Description

@narayanls

What happened?

Opening the tray drawer freezes the whole shell for ~500 ms on every click,
and up to ~20 s on the first open after boot.

Possible Cause
One tray item (wayscriber) reports IconThemePath = /usr/share/icons.
TrayWidget::resolveFromTrayThemePath() recursively walks that directory to build
an icon index. The drawer creates a new TrayWidget on each open and destroys it
in TrayDrawerPanel::onClose(), so the index is lost and the full walk repeats on
every open, synchronously on the main loop.

Workaround
Pinning the item to the bar (pinned = ["wayscriber"]) takes it out of the drawer,
and the drawer then opens instantly.

Suggestion (according to Claude IA)
Cache the IconThemePath index outside the widget (e.g. in the tray service,
keyed by path), or build it off the main loop, so that one misbehaving tray item
can't stall the shell.

Steps to reproduce

  1. Install wayscriber from AUR in Niri or Umbriel
  2. Use widget tray icons with drawer
  3. Click to open tray icons in the bar

Diagnostics

Wayscriber 0.9.26 (commit 22dc33e, built 2026-10-13)
Install source: unknown
Desktop: umbriel
Wayland display: wayland-0
Features: dbus, portal, tray, toolbar-gtk, tablet-input

Compositor / desktop

Niri

How did you install Wayscriber?

AUR

Logs (optional)

**Version:** Noctalia 5.3.0 (CachyOS, tested on both Niri and Umbriel)

surface prepareFrame callback took 494.1ms (…, 140x60 logical)
surface prepareFrame callback took 20468.7ms (…, 140x60 logical)   # first open after boot

`strace -c` during a single drawer open: 84,748 `newfstatat` calls (0.48 s).

Activity

  1. devmobasa commented on Oct 16, 2026

    @devmobasa
    Owner

    Thank you for the clear report and the strace data! Your analysis is correct.

    The problem has two parts:

    #413 removes the Wayscriber part, and it is now in main. An install under /usr no longer sends an IconThemePath. An install in a custom location, such as /opt, still sends its own icon folder.

    We reproduced the delay with Noctalia 5.3.0 in a test session on Sway. With the old build, every drawer open was slow. With main, the delay was gone and the icon still showed. The empty WAYSCRIBER_ICON_THEME_PATH setting below gave the same result. Our test did not use niri or a cold boot, so a test on your system is still useful.

    If you can, please test from main branch. It should be fixed on main.

    If you do so:

    1. Build Wayscriber from main. The From source section lists the dependencies.
      git clone https://github.com/devmobasa/wayscriber.git
      cd wayscriber
      cargo build --release
    2. Stop the installed daemon. If you use systemd, run systemctl --user stop wayscriber.service.
    3. Start the new build with ./target/release/wayscriber --daemon.
    4. Remove wayscriber from the pinned list in Noctalia, so that the icon is in the drawer again.
    5. Open the drawer several times.
    6. When you finish the test, stop the new build. Then start the installed daemon again with systemctl --user start wayscriber.service.

    Then please answer:

    • Does the drawer open without the delay?
    • Does the Wayscriber icon still show correctly?

    If you cannot build main, you can get the same result with the current release:

    • If you start Wayscriber with systemd, run systemctl --user edit wayscriber.service. Add these lines, then run systemctl --user restart wayscriber.service:
      [Service]
      Environment=WAYSCRIBER_ICON_THEME_PATH=
    • If you start Wayscriber from your compositor configuration, start it with WAYSCRIBER_ICON_THEME_PATH= wayscriber --daemon.

    With this setting, you can also reboot and report if the first open after boot is fast. That first open had the 20-second delay.

  2. narayanls commented on Oct 16, 2026

    @narayanls
    Author

    Hello again, finished testing and it works! No more freezes.

  3. devmobasa commented on Oct 16, 2026

    @devmobasa
    Owner

    That's great! Thanks for reporting!

    The fix is in main, and it will be in the next release. Until then, you can keep the WAYSCRIBER_ICON_THEME_PATH= setting or the pinned icon.

    I am closing this issue now. If the freeze comes back, or if the Wayscriber icon does not show, please reopen it.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions