Skip to content

fix: prevent crash when enabling system tray on KDE Plasma 6 / Wayland#381

Merged
Splode merged 1 commit into
mainfrom
bugfix/kde-plasma-6-system-tray-panic
Apr 2, 2026
Merged

fix: prevent crash when enabling system tray on KDE Plasma 6 / Wayland#381
Splode merged 1 commit into
mainfrom
bugfix/kde-plasma-6-system-tray-panic

Conversation

@Splode

@Splode Splode commented Apr 2, 2026

Copy link
Copy Markdown
Owner

On Linux systems without libayatana-appindicator3 or libappindicator3 installed (common on KDE Plasma 6 / Wayland), libappindicator-sys panics inside an extern "C" function when TrayIconBuilder::build() is called. Because the panic cannot unwind, the process aborts. Since tray_icon_enabled is persisted to SQLite before the crash, every subsequent launch also aborts before the window appears.

Fix: probe for the shared library via dlopen before calling TrayIconBuilder::build(). If none of the four candidate .so names are loadable, create_tray returns early with a warning log instead of aborting the process.

To prevent the setting from being enabled on unsupported systems, the System Tray section in Settings > System is now hidden on Linux when the probe fails. A new tray_supported IPC command exposes the probe result to the frontend, called once on mount in SystemSection.

The library can be installed on Arch / Manjaro with:
sudo pacman -S libayatana-appindicator

Resolves #380

On Linux systems without libayatana-appindicator3 or libappindicator3
installed (common on KDE Plasma 6 / Wayland), libappindicator-sys panics
inside an extern "C" function when TrayIconBuilder::build() is called.
Because the panic cannot unwind, the process aborts. Since tray_icon_enabled
is persisted to SQLite before the crash, every subsequent launch also aborts
before the window appears.

Fix: probe for the shared library via dlopen before calling
TrayIconBuilder::build(). If none of the four candidate .so names are
loadable, create_tray returns early with a warning log instead of
aborting the process.

To prevent the setting from being enabled on unsupported systems, the
System Tray section in Settings > System is now hidden on Linux when
the probe fails. A new tray_supported IPC command exposes the probe
result to the frontend, called once on mount in SystemSection.

The library can be installed on Arch / Manjaro with:
  `sudo pacman -S libayatana-appindicator`
@Splode Splode added the bug Something isn't working label Apr 2, 2026
@Splode Splode merged commit 692e67a into main Apr 2, 2026
8 checks passed
@Splode Splode deleted the bugfix/kde-plasma-6-system-tray-panic branch April 2, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App freezes on startup when system tray icon is enabled (KDE Plasma 6 / Wayland)

1 participant