diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index c0d3d28f..10700721 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -3583,6 +3583,7 @@ if test "$enable_user32_rawinput_mouse" -eq 1; then patch_apply user32-rawinput-mouse/0010-user32-Implement-GetRegisteredRawInputDevices.patch patch_apply user32-rawinput-mouse/0011-dinput8-Add-support-for-dinput-devices-that-use-raw-.patch patch_apply user32-rawinput-mouse/0012-dinput8-Use-raw-input-interface-for-dinput8-mouse-de.patch + patch_apply user32-rawinput-mouse/0013-dinput-Fix-rawinput-events-sequence-number.patch ( printf '%s\n' '+ { "Rémi Bernon", "user32/tests: Add rawinput test for ClipCursor interactions.", 1 },'; printf '%s\n' '+ { "Rémi Bernon", "user32/tests: Add rawinput test for cross-thread interactions.", 1 },'; @@ -3596,6 +3597,7 @@ if test "$enable_user32_rawinput_mouse" -eq 1; then printf '%s\n' '+ { "Rémi Bernon", "user32: Implement GetRegisteredRawInputDevices.", 1 },'; printf '%s\n' '+ { "Rémi Bernon", "dinput8: Add support for dinput devices that use raw input interface.", 1 },'; printf '%s\n' '+ { "Rémi Bernon", "dinput8: Use raw input interface for dinput8 mouse device.", 1 },'; + printf '%s\n' '+ { "Rémi Bernon", "dinput: Fix rawinput events sequence number.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/user32-rawinput-mouse/0013-dinput-Fix-rawinput-events-sequence-number.patch b/patches/user32-rawinput-mouse/0013-dinput-Fix-rawinput-events-sequence-number.patch new file mode 100644 index 00000000..1a28e0ca --- /dev/null +++ b/patches/user32-rawinput-mouse/0013-dinput-Fix-rawinput-events-sequence-number.patch @@ -0,0 +1,64 @@ +From bc5c3fdd603688460b74c007a1172004a2c8ff30 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Bernon?= +Date: Wed, 8 Apr 2020 15:35:32 +0200 +Subject: [PATCH] dinput: Fix rawinput events sequence number. + +--- + dlls/dinput/mouse.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c +index 5a624949867..6480a5adac6 100644 +--- a/dlls/dinput/mouse.c ++++ b/dlls/dinput/mouse.c +@@ -333,6 +333,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + RAWINPUT raw_input; + UINT size; + POINT rel, pt; ++ DWORD seq; + + static const USHORT mouse_button_flags[] = + { +@@ -374,6 +375,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + FIXME( "Unimplemented MOUSE_ATTRIBUTES_CHANGED flag\n" ); + + EnterCriticalSection(&This->base.crit); ++ seq = This->base.dinput->evsequence++; + + rel.x = raw_input.data.mouse.lLastX; + rel.y = raw_input.data.mouse.lLastY; +@@ -399,11 +401,11 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + + if (rel.x) + queue_event(iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_X_AXIS_INSTANCE) | DIDFT_RELAXIS, +- pt.x, GetCurrentTime(), This->base.dinput->evsequence); ++ pt.x, GetCurrentTime(), seq); + + if (rel.y) + queue_event(iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS, +- pt.y, GetCurrentTime(), This->base.dinput->evsequence); ++ pt.y, GetCurrentTime(), seq); + + if (rel.x || rel.y) + { +@@ -416,7 +418,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + { + This->m_state.lZ += (wdata = (SHORT)raw_input.data.mouse.usButtonData); + queue_event(iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_Z_AXIS_INSTANCE) | DIDFT_RELAXIS, +- wdata, GetCurrentTime(), This->base.dinput->evsequence); ++ wdata, GetCurrentTime(), seq); + ret = This->clipped; + } + +@@ -426,7 +428,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM + { + This->m_state.rgbButtons[i / 2] = 0x80 - (i % 2) * 0x80; + queue_event(iface, DIDFT_MAKEINSTANCE(WINE_MOUSE_BUTTONS_INSTANCE + (i / 2)) | DIDFT_PSHBUTTON, +- This->m_state.rgbButtons[i / 2], GetCurrentTime(), This->base.dinput->evsequence); ++ This->m_state.rgbButtons[i / 2], GetCurrentTime(), seq); + } + } + +-- +2.26.0 +