From 6b51cc02c368037fa4cb6b159474dc2daba51c7c Mon Sep 17 00:00:00 2001 From: Johannes Schultz Date: Thu, 26 Sep 2024 20:41:01 +0000 Subject: [PATCH] [Fix] Pattern tab: Avoid sticky selection key when focus is in another view. git-svn-id: https://source.openmpt.org/svn/openmpt/trunk/OpenMPT@21764 56274372-70c3-4bfc-bfc3-4c3a0b034d27 --- mptrack/View_pat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mptrack/View_pat.cpp b/mptrack/View_pat.cpp index df5407b904..b567e2107f 100644 --- a/mptrack/View_pat.cpp +++ b/mptrack/View_pat.cpp @@ -421,7 +421,7 @@ void CViewPattern::SetModified(bool updateAllViews) bool CViewPattern::IsSelectionPressed() const { - return CMainFrame::GetInputHandler()->SelectionPressed(); + return ::GetFocus() == m_hWnd && CMainFrame::GetInputHandler()->SelectionPressed(); } @@ -1165,7 +1165,7 @@ void CViewPattern::OnLButtonDown(UINT nFlags, CPoint point) SendCtrlMessage(CTRLMSG_PAT_FOLLOWSONG, 0); } - if(CMainFrame::GetInputHandler()->SelectionPressed() + if(IsSelectionPressed() && (m_Status[psShiftSelect] || m_Selection.GetUpperLeft() == m_Selection.GetLowerRight() || !m_Selection.Contains(pointCursor)))