From f4f859003e2d17ab6d457e552ccdde775899b328 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Mar 2017 16:44:00 +0300 Subject: StdMsg: fix for auto-closing the only tab in a container --- src/core/stdmsg/src/chat_window.cpp | 8 +++++++- src/core/stdmsg/src/stdafx.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp index 75a34c72d2..f2391f0d42 100644 --- a/src/core/stdmsg/src/chat_window.cpp +++ b/src/core/stdmsg/src/chat_window.cpp @@ -952,6 +952,12 @@ void CChatRoomDlg::OnInitDialog() NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN); } +void CChatRoomDlg::OnClose() +{ + if (g_Settings.bTabsEnable) + SendMessage(GetParent(m_hwndParent), GC_REMOVETAB, 0, (LPARAM)this); +} + void CChatRoomDlg::OnDestroy() { NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING); @@ -1608,7 +1614,7 @@ LABEL_SHOWWINDOW: if (g_Settings.bTabsEnable) SendMessage(GetParent(m_hwndParent), GC_REMOVETAB, 0, (LPARAM)this); Close(); - break; + return 0; case GC_CHANGEFILTERFLAG: m_si->iLogFilterFlags = lParam; diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h index f39b6c0199..3e0276e705 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -197,6 +197,7 @@ public: CChatRoomDlg(SESSION_INFO*); virtual void OnInitDialog() override; + virtual void OnClose() override; virtual void OnDestroy() override; virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) override; -- cgit v1.2.3