diff options
-rw-r--r-- | plugins/UserInfoEx/src/classPsTree.cpp | 3 | ||||
-rw-r--r-- | src/core/stduserinfo/src/userinfo.cpp | 1 | ||||
-rw-r--r-- | src/mir_app/src/options.cpp | 13 | ||||
-rw-r--r-- | src/mir_core/src/Windows/CDlgBase.cpp | 3 |
4 files changed, 7 insertions, 13 deletions
diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index 9dc874d8eb..64f5bf5b03 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -908,8 +908,7 @@ int CPsTree::OnApply() if (pti == nullptr) return 1; - PSHNOTIFY pshn; - pshn.hdr.idFrom = 0; + PSHNOTIFY pshn = {}; pshn.hdr.code = PSN_KILLACTIVE; pshn.hdr.hwndFrom = pti->Wnd(); if (SendMessage(pshn.hdr.hwndFrom, WM_NOTIFY, 0, (LPARAM)&pshn)) diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp index 4126dd5974..3ccc299225 100644 --- a/src/core/stduserinfo/src/userinfo.cpp +++ b/src/core/stduserinfo/src/userinfo.cpp @@ -337,6 +337,7 @@ public: }
pshn.hdr.code = PSN_APPLY;
+ pshn.lParam = IDOK;
for (auto &odp : m_pages) {
if (odp->hwnd == nullptr || !odp->changed)
continue;
diff --git a/src/mir_app/src/options.cpp b/src/mir_app/src/options.cpp index c29013a30e..a0766677f1 100644 --- a/src/mir_app/src/options.cpp +++ b/src/mir_app/src/options.cpp @@ -814,6 +814,9 @@ public: bool OnApply() override
{
+ if (GetParent(GetFocus()) == GetDlgItem(m_hwnd, IDC_KEYWORD_FILTER))
+ return false;
+
m_btnApply.Disable();
SetFocus(m_pageTree.GetHwnd());
@@ -832,6 +835,7 @@ public: PSHNOTIFY pshn = {};
pshn.hdr.code = PSN_APPLY;
+ pshn.lParam = (m_bExiting) ? IDOK : IDC_APPLY;
for (auto &p : m_arOpd) {
if (p == nullptr)
continue;
@@ -883,15 +887,6 @@ public: m_btnApply.Disable();
}
- void OnOk(void*)
- {
- if (GetParent(GetFocus()) == GetDlgItem(m_hwnd, IDC_KEYWORD_FILTER))
- return;
-
- OnApply();
- Close();
- }
-
void OnCancel(CCtrlButton*)
{
PSHNOTIFY pshn;
diff --git a/src/mir_core/src/Windows/CDlgBase.cpp b/src/mir_core/src/Windows/CDlgBase.cpp index 9740a5b19f..c2ffcb3210 100644 --- a/src/mir_core/src/Windows/CDlgBase.cpp +++ b/src/mir_core/src/Windows/CDlgBase.cpp @@ -349,8 +349,7 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (pnmh->idFrom == 0) {
switch (pnmh->code) {
case PSN_APPLY:
- if (LPPSHNOTIFY(lParam)->lParam != 3) // IDC_APPLY
- m_bExiting = true;
+ m_bExiting = ((PSHNOTIFY*)pnmh)->lParam != 3; // IDC_APPLY
if (!VerifyControls(&CCtrlBase::OnApply))
m_bExiting = false;
|