@@ -1505,13 +1505,7 @@ void PMTraceConsumer::HandleWin32kEvent(EVENT_RECORD* pEventRecord)
15051505 if (mLastInputDeviceType == InputDeviceType::Mouse) {
15061506 auto it = mReceivedMouseClickByHwnd .find (hWnd);
15071507 if (it != mReceivedMouseClickByHwnd .end ()) {
1508- // If the time from the last mouse click time to this input
1509- // is greater than 1700000 ticks then we assume this is a mouse
1510- // click down and record the time. If the user happens to be
1511- // holding down the mouse button this could be incorrect. In addition
1512- // if we now have a xform time when we previously didn't then record
1513- // the time.
1514- if (it->second .CurrentMouseClickTime - it->second .LastMouseClickTime > 1700000 ) {
1508+ if (it->second .LastMouseClickTime < it->second .CurrentMouseClickTime ) {
15151509 ii->second .MouseClickTime = it->second .CurrentMouseClickTime ;
15161510 ii->second .XFormTime = it->second .CurrentXFormTime ;
15171511 it->second .LastMouseClickTime = it->second .CurrentMouseClickTime ;
@@ -1535,11 +1529,7 @@ void PMTraceConsumer::HandleWin32kEvent(EVENT_RECORD* pEventRecord)
15351529
15361530 auto it = mReceivedMouseClickByHwnd .find (hWnd);
15371531 if (it != mReceivedMouseClickByHwnd .end ()) {
1538- // Have seen where we get two pairs of InputDeviceRead_Stop
1539- // OnInputXformUpdate_Info events back to back and then a
1540- // RetrieveInputMessage_Info. As in retrieve check if there is
1541- // 1500000 tick gap in an attempt to only capture the mouse down
1542- if (mLastInputDeviceReadTime - it->second .LastMouseClickTime > 1500000 ) {
1532+ if (it->second .LastMouseClickTime < mLastInputDeviceReadTime ) {
15431533 it->second .CurrentMouseClickTime = mLastInputDeviceReadTime ;
15441534 it->second .CurrentXFormTime = xFormQPCTime;
15451535 }
0 commit comments