From 19bf42ce996ea933dfbb234034ff317a7edd3bf0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 25 Mar 2017 13:18:45 +0300 Subject: fix to prevent duplicate event processing --- src/mir_app/src/srmm_base.cpp | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index f5dd07a69e..01ef9a8063 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -125,36 +125,36 @@ static LRESULT CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wPar ///////////////////////////////////////////////////////////////////////////////////////// -LRESULT CSrmmBaseDialog::WndProc_Log(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) -{ - return 0; -} - static LRESULT CALLBACK stubLogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); if (pDlg != nullptr) - pDlg->WndProc_Log(msg, wParam, lParam); + return pDlg->WndProc_Log(msg, wParam, lParam); return mir_callNextSubclass(hwnd, stubLogProc, msg, wParam, lParam); } -///////////////////////////////////////////////////////////////////////////////////////// - -LRESULT CSrmmBaseDialog::WndProc_Message(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) +LRESULT CSrmmBaseDialog::WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam) { - return 0; + return mir_callNextSubclass(m_log.GetHwnd(), stubLogProc, msg, wParam, lParam); } +///////////////////////////////////////////////////////////////////////////////////////// + static LRESULT CALLBACK stubMessageProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); if (pDlg != nullptr) - pDlg->WndProc_Message(msg, wParam, lParam); + return pDlg->WndProc_Message(msg, wParam, lParam); return mir_callNextSubclass(hwnd, stubMessageProc, msg, wParam, lParam); } +LRESULT CSrmmBaseDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) +{ + return mir_callNextSubclass(m_message.GetHwnd(), stubMessageProc, msg, wParam, lParam); +} + ///////////////////////////////////////////////////////////////////////////////////////// // process mouse - hovering for the nickname list.fires events so the protocol can // show the userinfo - tooltip. @@ -266,6 +266,15 @@ static void CALLBACK ChatTimerProc(HWND hwnd, UINT, UINT_PTR idEvent, DWORD) KillTimer(hwnd, idEvent); } +static LRESULT CALLBACK stubNicklistProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); + if (pDlg != nullptr) + return pDlg->WndProc_Nicklist(msg, wParam, lParam); + + return mir_callNextSubclass(hwnd, stubNicklistProc, msg, wParam, lParam); +} + LRESULT CSrmmBaseDialog::WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam) { RECT rc; @@ -364,16 +373,8 @@ LRESULT CSrmmBaseDialog::WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam } return 1; } - return 0; -} -static LRESULT CALLBACK stubNicklistProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) -{ - CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA); - if (pDlg != nullptr) - pDlg->WndProc_Nicklist(msg, wParam, lParam); - - return mir_callNextSubclass(hwnd, stubNicklistProc, msg, wParam, lParam); + return mir_callNextSubclass(m_nickList.GetHwnd(), stubNicklistProc, msg, wParam, lParam); } ///////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3