Hofknecht SystemTrayMenu 3

Development

Rebuilding SystemTrayMenu in Rust and Slint

Version 1 was a C# program with WinForms, Windows only. Version 3 is a rewrite in Rust with a Slint user interface: one codebase for Windows, macOS and Linux, about 20 MB of memory, no runtime to install. What the switch brought, and where it got stuck.

Why a rewrite

Structure

Three crates, split by what depends on the system:

What Rust and Slint brought

MeasuredFor comparison
Memory, Windows21 MB idle with the tray icon91 MB with the OpenGL renderer, 131 MB for a port of the old code to .NET 9
Memory, macOS24 MB after 12 hours86 MB with the GPU renderer
Startup, macOS70 to 80 ms
Idle, macOS0.0 % CPU, no wakeups in 10 minutes
Program sizemacOS 11.3 MB, Windows 13.3 MB, Linux 22.6 MBone file, no runtime

The biggest step was Slint’s software renderer on all three systems. With OpenGL, the hidden menu window kept its buffers in graphics memory. The switch also dropped FemtoVG, glutin and 76 entries from Cargo.lock. Slint bundles the translations for 28 languages into the binary, no files next to it.

Stumbling blocks

Testing without a screen

The UI tests run on Slint’s testing backend, without any window. A silent self-test starts the real app, presses keys and logs the timings. Every release passes the tests on Windows, macOS and Linux, and every Clippy warning counts as an error.

Disclosure: I’m the developer. Much of the code of version 3 is written by an AI coding assistant (Claude) under my direction; every release passes automated tests on Windows, macOS and Linux.

Free downloadMore about SystemTrayMenu

Read on: What’s new in SystemTrayMenu · Press kit · Slint