Author: weiden Date: Sat Jul 28 21:16:51 2007 New Revision: 27952
URL: http://svn.reactos.org/svn/reactos?rev=27952&view=rev Log: Correctly calculate message time. Fixes slow clicks being interpreted as double clicks. See issue #2238 for more details.
Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h trunk/reactos/subsystems/win32/win32k/ntuser/input.c trunk/reactos/subsystems/win32/win32k/ntuser/message.c trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
Modified: trunk/reactos/subsystems/win32/win32k/include/msgqueue.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/msgqueue.h (original) +++ trunk/reactos/subsystems/win32/win32k/include/msgqueue.h Sat Jul 28 21:16:51 2007 @@ -268,6 +268,12 @@ VOID FASTCALL MsqRemoveTimersWindow(PUSER_MESSAGE_QUEUE MessageQueue, HWND Wnd);
+static __inline LONG +MsqCalculateMessageTime(IN PLARGE_INTEGER TickCount) +{ + return (LONG)(TickCount->QuadPart * (KeQueryTimeIncrement() / 10000)); +} + #endif /* _WIN32K_MSGQUEUE_H */
/* EOF */
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/input.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/input.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/input.c Sat Jul 28 21:16:51 2007 @@ -984,7 +984,7 @@ { LARGE_INTEGER LargeTickCount; KeQueryTickCount(&LargeTickCount); - mi->time = LargeTickCount.u.LowPart; + mi->time = MsqCalculateMessageTime(&LargeTickCount); }
SwapButtons = CurInfo->SwapButtons;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/message.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/message.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/message.c Sat Jul 28 21:16:51 2007 @@ -1224,7 +1224,7 @@ IntGetCursorLocation(PsGetCurrentThreadWin32Thread()->Desktop->WindowStation, &KernelModeMsg.pt); KeQueryTickCount(&LargeTickCount); - KernelModeMsg.time = LargeTickCount.u.LowPart * (KeQueryTimeIncrement() / 10000); + KernelModeMsg.time = MsqCalculateMessageTime(&LargeTickCount); MsqPostMessage(Window->MessageQueue, &KernelModeMsg, NULL != MsgMemoryEntry && 0 != KernelModeMsg.lParam, QS_POSTMESSAGE);
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c Sat Jul 28 21:16:51 2007 @@ -163,7 +163,7 @@ }
KeQueryTickCount(&LargeTickCount); - Msg->time = LargeTickCount.u.LowPart; + Msg->time = MsqCalculateMessageTime(&LargeTickCount);
/* * If we got WM_MOUSEMOVE and there are already messages in the @@ -694,7 +694,7 @@ Msg.lParam = lParam;
KeQueryTickCount(&LargeTickCount); - Msg.time = LargeTickCount.u.LowPart; + Msg.time = MsqCalculateMessageTime(&LargeTickCount); /* We can't get the Msg.pt point here since we don't know thread (and thus the window station) the message will end up in yet. */
@@ -770,7 +770,7 @@ Mesg.wParam = wParam; Mesg.lParam = lParam; KeQueryTickCount(&LargeTickCount); - Mesg.time = LargeTickCount.u.LowPart; + Mesg.time = MsqCalculateMessageTime(&LargeTickCount); IntGetCursorLocation(WinSta, &Mesg.pt); MsqPostMessage(Window->MessageQueue, &Mesg, FALSE, QS_HOTKEY); ObmDereferenceObject(Window); @@ -1787,7 +1787,7 @@ Msg->wParam = (WPARAM) Timer->IDEvent; Msg->lParam = (LPARAM) Timer->TimerFunc; KeQueryTickCount(&LargeTickCount); - Msg->time = LargeTickCount.u.LowPart; + Msg->time = MsqCalculateMessageTime(&LargeTickCount); IntGetCursorLocation(PsGetCurrentThreadWin32Thread()->Desktop->WindowStation, &Msg->pt);