From 52968512284c1967ab8168c7dfbea4aaf458b2a1 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Thu, 29 May 2014 21:22:55 +0200 Subject: [PATCH] BrowseRefsDlg: Do not open context menu if user clicks on list header Signed-off-by: Sven Strickroth --- src/TortoiseProc/BrowseRefsDlg.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/TortoiseProc/BrowseRefsDlg.cpp b/src/TortoiseProc/BrowseRefsDlg.cpp index fee6ea78d..de59dcdd8 100644 --- a/src/TortoiseProc/BrowseRefsDlg.cpp +++ b/src/TortoiseProc/BrowseRefsDlg.cpp @@ -829,7 +829,13 @@ CString CBrowseRefsDlg::GetFullRefName(CString partialRefName) void CBrowseRefsDlg::OnContextMenu(CWnd* pWndFrom, CPoint point) { if(pWndFrom==&m_RefTreeCtrl) OnContextMenu_RefTreeCtrl(point); - else if(pWndFrom==&m_ListRefLeafs) OnContextMenu_ListRefLeafs(point); + else if (pWndFrom == &m_ListRefLeafs) + { + CRect headerPosition; + m_ListRefLeafs.GetHeaderCtrl()->GetWindowRect(headerPosition); + if (!headerPosition.PtInRect(point)) + OnContextMenu_ListRefLeafs(point); + } } void CBrowseRefsDlg::OnContextMenu_RefTreeCtrl(CPoint point) -- 2.11.4.GIT