Skip to content

Commit

Permalink
improve mouse cursor updates when leaving in-place controls (#2572)
Browse files Browse the repository at this point in the history
  • Loading branch information
adipose committed Feb 15, 2024
1 parent 2d57652 commit e459a32
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/mpc-hc/PlayerListCtrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,8 @@ bool CPlayerListCtrl::PrepareInPlaceControl(int nRow, int nCol, CRect& rect)

rect.DeflateRect(1, 0, 0, 1);
inPlaceControl = true;
inPlaceControlRect = rect;
ClientToScreen(inPlaceControlRect);
return true;
}

Expand Down Expand Up @@ -1116,10 +1118,13 @@ void CPlayerListCtrl::OnXButtonDblClk(UINT nFlags, UINT nButton, CPoint point)

BOOL CPlayerListCtrl::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) {
if (inPlaceControl) {
return FALSE;
} else {
return CListCtrl::OnSetCursor(pWnd, nHitTest, message);
POINT p;
GetCursorPos(&p);
if (inPlaceControlRect.PtInRect(p)) {
return FALSE;
}
}
return CListCtrl::OnSetCursor(pWnd, nHitTest, message);
}


Expand Down
1 change: 1 addition & 0 deletions src/mpc-hc/PlayerListCtrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class CPlayerListCtrl : public CMPCThemePlayerListCtrl
int m_nItemClicked, m_nSubItemClicked;
int m_tStartEditingDelay;
bool inPlaceControl;
CRect inPlaceControlRect;
UINT_PTR m_nTimerID;

bool PrepareInPlaceControl(int nRow, int nCol, CRect& rect);
Expand Down

0 comments on commit e459a32

Please sign in to comment.