diff --git a/src/system_tray.cpp b/src/system_tray.cpp index 4b940a40..ed66357a 100644 --- a/src/system_tray.cpp +++ b/src/system_tray.cpp @@ -212,6 +212,12 @@ namespace system_tray { return 1; } } + + // Wait for the shell to be initialized before registering the tray icon. + // This ensures the tray icon works reliably after a logoff/logon cycle. + while (GetShellWindow() == nullptr) { + Sleep(1000); + } #endif if (tray_init(&tray) < 0) {