OpenVPN / openvpn-gui

OpenVPN GUI is a graphical frontend for OpenVPN running on Windows 7 / 8 / 10. It creates an icon in the notification area from which you can control OpenVPN to start/stop your VPN tunnels, view the log and do other useful things.
Other
1.38k stars 397 forks source link

Always update tray icon on state change #669

Closed selvanair closed 4 months ago

selvanair commented 5 months ago

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

cron2 commented 4 months ago

Looks good to me (looked at some other uses of CheckAndSetTrayIcon() and at the function itself).