Skip to content

fix: add periodic menu refresh for dynamic labels in tray icon#24

Merged
MudDev merged 1 commit into
mainfrom
deamon-threads
May 5, 2026
Merged

fix: add periodic menu refresh for dynamic labels in tray icon#24
MudDev merged 1 commit into
mainfrom
deamon-threads

Conversation

@MudDev
Copy link
Copy Markdown

@MudDev MudDev commented May 5, 2026

pystray on Windows builds the Win32 menu structure once during icon.run(), which starts in a background thread before main.file_server is created. The lambdas for IP/Connections/Transfer are evaluated at menu creation time, get the "no data" defaults, and those strings are baked into the HMENU, never updated again.

Added a daemon thread that calls icon.update_menu() every 5 seconds, which rebuilds the menu and re-evaluates the lambdas with the current server state.

@MudDev MudDev merged commit 6433fa3 into main May 5, 2026
3 checks passed
@MudDev MudDev deleted the deamon-threads branch May 5, 2026 15:30
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