mirror of https://github.com/OpenVPN/openvpn-gui
End open dialogs on state change
Modal dialogs opened within the connection thread may hang around if the connection restarts. Intercept the state change message and call EndDialog when that happens. Signed-off-by: Selva Nair <selva.nair@gmail.com>pull/608/head
parent
f8a243fbe8
commit
7cc3ccda84
14
openvpn.c
14
openvpn.c
|
@ -658,6 +658,10 @@ UserAuthDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_OVPN_STATE: /* state changed -- destroy the dialog */
|
||||
EndDialog(hwndDlg, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if (GetDlgCtrlID((HWND) lParam) == ID_TXT_WARNING)
|
||||
{
|
||||
|
@ -860,14 +864,16 @@ GenericPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
* auth succeeds or connection restarts/aborts.
|
||||
* Close the CR_TEXT dialog if state changes to anything
|
||||
* other than GET_CONFIG. The state is in lParam.
|
||||
* For other auth dialogs any state change signals a restart: end the dialog
|
||||
*/
|
||||
param = (auth_param_t *) GetProp(hwndDlg, cfgProp);
|
||||
if ((param->flags & FLAG_CR_TYPE_CRTEXT)
|
||||
&& strcmp((const char *) lParam, "GET_CONFIG"))
|
||||
if (!(param->flags & FLAG_CR_TYPE_CRTEXT)
|
||||
|| strcmp((const char *) lParam, "GET_CONFIG"))
|
||||
{
|
||||
EndDialog(hwndDlg, LOWORD(wParam));
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
case WM_CLOSE:
|
||||
EndDialog(hwndDlg, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
@ -973,6 +979,10 @@ PrivKeyPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_OVPN_STATE: /* state changed -- destroy the dialog */
|
||||
EndDialog(hwndDlg, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if (GetDlgCtrlID((HWND) lParam) == ID_TXT_WARNING)
|
||||
{
|
||||
|
|
4
pkcs11.c
4
pkcs11.c
|
@ -621,6 +621,10 @@ QueryPkcs11DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_OVPN_STATE: /* state changed -- destroy the dialog */
|
||||
EndDialog(hwndDlg, LOWORD(wParam));
|
||||
return TRUE;
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
if (GetDlgCtrlID((HWND) lParam) == ID_TXT_WARNING)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue