Skip to content

Commit

Permalink
improve double-click behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
clsid2 committed Aug 5, 2024
1 parent 9a7f5b1 commit 924e173
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/mpc-hc/MouseTouch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,7 @@ void CMouse::InternalOnLButtonDown(UINT nFlags, const CPoint& point)

if (m_bLeftUpDelayed) {
KillTimer(GetWnd(), (UINT_PTR)this);
if (bDouble) {
m_bLeftUpDelayed = false;
m_bLeftUpIgnoreNext = true;
} else {
if (!bDouble) {
PerformDelayedLeftUp();
}
}
Expand All @@ -331,6 +328,16 @@ void CMouse::InternalOnLButtonDown(UINT nFlags, const CPoint& point)
ret = OnButton(wmcmd::LDOWN, point);
}
if (bDouble) {
// perform the LeftUp command before double-click
// reason is that toggling fullscreen can move the video window, which can cause the LeftUp action to not be processed properly
// ToDo: rewrite code to trigger doubleclick at second LeftUp instead of LeftDown
if (m_bLeftUpDelayed) {
// the first LeftUp was delayed and then skipped, so skip second one as well
m_bLeftUpDelayed = false;
} else {
OnButton(wmcmd::LUP, point);
}
m_bLeftUpIgnoreNext = true;
ret = OnButton(wmcmd::LDBLCLK, point) || ret;
}
if (!ret) {
Expand Down

0 comments on commit 924e173

Please sign in to comment.