Module: wine Branch: master Commit: 31876695120f2fe6b4ecf60d73c36472607e5bf2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=31876695120f2fe6b4ecf60d73...
Author: Vitaliy Margolen wine-patches@kievinfo.com Date: Fri Feb 8 08:01:42 2008 -0700
dinput: Skip old mouse movement events.
---
dlls/dinput/mouse.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 35ddc0b..72fbbf6 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -64,6 +64,7 @@ struct SysMouseImpl BOOL need_warp; DWORD last_warped;
+ DWORD last_event_time; /* This is for mouse reporting. */ DIMOUSESTATE2 m_state; }; @@ -280,6 +281,9 @@ static void dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARA { POINT pt, pt1;
+ /* Skip old movement events */ + if (This->last_event_time - hook->time < 2000) break; + GetCursorPos(&pt); This->m_state.lX += pt.x = hook->pt.x - pt.x; This->m_state.lY += pt.y = hook->pt.y - pt.y; @@ -355,6 +359,8 @@ static void dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARA wdata, hook->time, This->base.dinput->evsequence++); }
+ This->last_event_time = hook->time; + LeaveCriticalSection(&This->base.crit); }