Skip to content

Commit 71dcef8

Browse files
committed
Fix systray icon sometimes not appearing after login
1 parent 53125ff commit 71dcef8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/system_tray.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ namespace system_tray {
212212
return 1;
213213
}
214214
}
215+
216+
// Wait for the shell to be initialized before registering the tray icon.
217+
// This ensures the tray icon works reliably after a logoff/logon cycle.
218+
while (GetShellWindow() == nullptr) {
219+
Sleep(1000);
220+
}
215221
#endif
216222

217223
if (tray_init(&tray) < 0) {

0 commit comments

Comments
 (0)