From 15710bfdbed4b6d9d7493cdbe39033ae43e8036e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 23 Apr 2020 14:28:18 +0300 Subject: StdMsg: - fixes #865 (new message pops up a window even if the "In background" option is turned on); - old window positioning code from Chat.dll removed; --- src/core/stdmsg/src/msgdialog.cpp | 9 --------- src/core/stdmsg/src/msgs.cpp | 10 ++++++---- src/core/stdmsg/src/tabs.cpp | 5 +++-- 3 files changed, 9 insertions(+), 15 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 20835dfe21..2897180152 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -228,15 +228,6 @@ bool CMsgDialog::OnInitDialog() } } - int flag = m_bNoActivate ? RWPF_HIDDEN : 0; - if (Utils_RestoreWindowPosition(m_hwnd, g_dat.bSavePerContact ? m_hContact : 0, SRMMMOD, "", flag)) { - if (g_dat.bSavePerContact) { - if (Utils_RestoreWindowPosition(m_hwnd, 0, SRMMMOD, "", flag | RWPF_NOMOVE)) - SetWindowPos(m_hwnd, nullptr, 0, 0, 450, 300, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW); - } - else SetWindowPos(m_hwnd, nullptr, 0, 0, 450, 300, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW); - } - if (m_bNoActivate) { SetWindowPos(m_hwnd, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW); StartFlash(); diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index d92f727c07..562f6cf058 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -94,10 +94,12 @@ static int MessageEventAdded(WPARAM hContact, LPARAM lParam) /* new message */ Skin_PlaySound("AlertMsg"); - char *szProto = Proto_GetBaseAccountName(hContact); - if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto)))) { - GetContainer()->AddPage(hContact); - return 0; + if (!g_dat.bDoNotStealFocus) { + char *szProto = Proto_GetBaseAccountName(hContact); + if (szProto && (g_dat.popupFlags & SRMMStatusToPf2(Proto_GetStatus(szProto)))) { + GetContainer()->AddPage(hContact); + return 0; + } } wchar_t toolTip[256]; diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp index 4a843b8490..03b68cd309 100644 --- a/src/core/stdmsg/src/tabs.cpp +++ b/src/core/stdmsg/src/tabs.cpp @@ -391,9 +391,10 @@ void CTabbedWindow::SetWindowPosition() return; } - if (Utils_RestoreWindowPosition(m_hwnd, g_dat.bSavePerContact ? m_pEmbed->m_hContact : 0, CHAT_MODULE, "room")) { + int flag = m_pEmbed->m_bNoActivate ? RWPF_HIDDEN : 0; + if (Utils_RestoreWindowPosition(m_hwnd, g_dat.bSavePerContact ? m_pEmbed->m_hContact : 0, CHAT_MODULE, "room", flag)) { if (g_dat.bSavePerContact) { - if (Utils_RestoreWindowPosition(m_hwnd, 0, CHAT_MODULE, "room", RWPF_NOMOVE)) + if (Utils_RestoreWindowPosition(m_hwnd, 0, CHAT_MODULE, "room", flag | RWPF_NOMOVE)) SetWindowPos(m_hwnd, nullptr, 0, 0, 550, 400, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW); } else SetWindowPos(m_hwnd, nullptr, 0, 0, 550, 400, SWP_NOZORDER | SWP_NOMOVE | SWP_SHOWWINDOW); -- cgit v1.2.3