diff options
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/ui_utils.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index ddc1088705..ff4de03f6c 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -163,12 +163,15 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (idCode == BN_CLICKED) {
// close dialog automatically if 'Cancel' button is pressed
- if (idCtrl == IDCANCEL && (m_autoClose & CLOSE_ON_CANCEL))
+ if (idCtrl == IDCANCEL && (m_autoClose & CLOSE_ON_CANCEL)) {
+ m_bExiting = true;
PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ }
// close dialog automatically if 'OK' button is pressed
if (idCtrl == IDOK && (m_autoClose & CLOSE_ON_OK)) {
// validate dialog data first
+ m_bExiting = true;
m_lresult = TRUE;
NotifyControls(&CCtrlBase::OnApply);
OnApply();
@@ -176,6 +179,8 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) // everything ok? good, let's close it
if (m_lresult == TRUE)
PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ else
+ m_bExiting = false;
}
}
}
@@ -214,6 +219,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) return FALSE;
case WM_CLOSE:
+ m_bExiting = true;
m_lresult = FALSE;
OnClose();
if (!m_lresult) {
@@ -225,6 +231,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) return TRUE;
case WM_DESTROY:
+ m_bExiting = true;
OnDestroy();
NotifyControls(&CCtrlBase::OnDestroy);
{
|