From 33325b7eaf05ae7264ab155eacb7cdd41c37c2d9 Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Thu, 8 Feb 2024 22:50:05 -0500 Subject: [PATCH] Always update tray icon on state change The tray icon and its tip text get updated to the connecting state when starting a new status window thread. This is not enough for persistent connections as these can be restarted from the hold state which does not go through a new thread creation. To see the bug, disconnect and reconnect a persistent connection and have it wait in the connecting state. The tray icon colour does not change to yellow and the tray tip message does not show the "Connecting to:" text. Fix by ensuring that CheckAndSetTrayIcon() or SetTrayIcon() gets called whenever a state change message is received. Fixes issue #668 Signed-off-by: Selva Nair --- openvpn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openvpn.c b/openvpn.c index b6228a1b..9f832250 100644 --- a/openvpn.c +++ b/openvpn.c @@ -438,6 +438,10 @@ OnStateChange(connection_t *c, char *data) SetStatusWinIcon(c->hwndStatus, ID_ICO_CONNECTING); } } + else + { + CheckAndSetTrayIcon(); + } } static void