summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-04-20 14:19:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-04-20 14:19:59 +0300
commit3ceeebafc2a65ba9e9ad8658268a3a9a8df1f9ca (patch)
treee429c6232c92218bbf3e3b336354f601d9890319 /src
parent25c5793e0be2d223cd8c3f562f574546cff81c30 (diff)
StdMsg: fixes #1291 (rclick -> Close tab doesn't close a tab)
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/tabs.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index f25439dd63..863c70e67e 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -607,13 +607,14 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
if ((i = TabCtrl_HitTest(((LPNMHDR)lParam)->hwndFrom, &tci)) == -1)
break;
- SESSION_INFO *si = ((CChatRoomDlg*)m_tab.GetNthPage(i))->m_si;
+ CMsgDialog *pDlg = (CMsgDialog*)m_tab.GetNthPage(i);
+ SESSION_INFO *si = pDlg->m_si;
ClientToScreen(GetDlgItem(m_hwnd, IDC_TAB), &tci.pt);
HMENU hSubMenu = GetSubMenu(g_hMenu, 1);
TranslateMenu(hSubMenu);
- if (si) {
+ if (si != nullptr) {
WORD w = db_get_w(si->hContact, si->pszModule, "TabPosition", 0);
if (w == 0)
CheckMenuItem(hSubMenu, ID_LOCKPOSITION, MF_BYCOMMAND | MF_UNCHECKED);
@@ -624,7 +625,7 @@ INT_PTR CTabbedWindow::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
switch (TrackPopupMenu(hSubMenu, TPM_RETURNCMD, tci.pt.x, tci.pt.y, 0, m_hwnd, nullptr)) {
case ID_CLOSE:
- SendMessage(m_hwnd, GC_REMOVETAB, 0, (LPARAM)m_tab.GetNthPage(i));
+ pDlg->CloseTab();
break;
case ID_LOCKPOSITION: