From c951935ab25197ce7c58716a339a010ba028f8e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 12 Apr 2017 20:08:02 +0300 Subject: fixes #796 (Double-clicking contact list entry no longer activates their window) --- src/core/stdmsg/src/msgs.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index 2e8d5752e0..5944e33f7d 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -115,9 +115,17 @@ INT_PTR SendMessageCmd(MCONTACT hContact, wchar_t *pwszInitialText) SendDlgItemMessageW(hwnd, IDC_SRMM_MESSAGE, EM_REPLACESEL, FALSE, (LPARAM)pwszInitialText); mir_free(pwszInitialText); } - ShowWindow(hwnd, SW_RESTORE); - SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); - SetForegroundWindow(hwnd); + + if (!g_Settings.bTabsEnable) { + HWND hwndContainer = GetParent(hwnd); + ShowWindow(hwndContainer, SW_RESTORE); + SetWindowPos(hwndContainer, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); + SetForegroundWindow(hwndContainer); + } + else { + CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + pDialog->m_tab.ActivatePage(pDialog->m_tab.GetDlgIndex(pDlg)); + } } else GetContainer()->AddPage(hContact, pwszInitialText, false); -- cgit v1.2.3