Rémi Bernon : dinput: Check for mouse warping in the poll callback.

Alexandre Julliard julliard at winehq.org
Wed Oct 20 15:58:41 CDT 2021


Module: wine
Branch: master
Commit: 59fad29102875842519ef5cbc19cd37c99460291
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=59fad29102875842519ef5cbc19cd37c99460291

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Wed Oct 20 11:29:31 2021 +0200

dinput: Check for mouse warping in the poll callback.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dinput/mouse.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c
index 5933d7e5f0f..7b8402b2bf5 100644
--- a/dlls/dinput/mouse.c
+++ b/dlls/dinput/mouse.c
@@ -472,27 +472,14 @@ static HRESULT WINAPI SysMouseWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface,
     }
     LeaveCriticalSection(&This->base.crit);
 
-    warp_check( This, FALSE );
     return DI_OK;
 }
 
-/******************************************************************************
-  *     GetDeviceData : gets buffered input data.
-  */
-static HRESULT WINAPI SysMouseWImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W iface,
-        DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags)
-{
-    SysMouseImpl *This = impl_from_IDirectInputDevice8W(iface);
-    HRESULT res;
-
-    res = IDirectInputDevice2WImpl_GetDeviceData(iface, dodsize, dod, entries, flags);
-    if (SUCCEEDED(res)) warp_check( This, FALSE );
-    return res;
-}
-
 static HRESULT mouse_internal_poll( IDirectInputDevice8W *iface )
 {
+    SysMouseImpl *impl = impl_from_IDirectInputDevice8W( iface );
     check_dinput_events();
+    warp_check( impl, FALSE );
     return DI_OK;
 }
 
@@ -710,7 +697,7 @@ static const IDirectInputDevice8WVtbl SysMouseWvt =
     IDirectInputDevice2WImpl_Acquire,
     IDirectInputDevice2WImpl_Unacquire,
     SysMouseWImpl_GetDeviceState,
-    SysMouseWImpl_GetDeviceData,
+    IDirectInputDevice2WImpl_GetDeviceData,
     IDirectInputDevice2WImpl_SetDataFormat,
     IDirectInputDevice2WImpl_SetEventNotification,
     IDirectInputDevice2WImpl_SetCooperativeLevel,




More information about the wine-cvs mailing list