Skip to content

Commit

Permalink
Always update tray icon on state change
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
selvanair authored and cron2 committed Feb 11, 2024
1 parent 813916e commit 579a418
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions openvpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ OnStateChange(connection_t *c, char *data)
SetStatusWinIcon(c->hwndStatus, ID_ICO_CONNECTING);
}
}
else
{
CheckAndSetTrayIcon();
}
}

static void
Expand Down

0 comments on commit 579a418

Please sign in to comment.