Enable user32-rawinput patchset

This commit is contained in:
Alistair Leslie-Hughes 2019-09-20 08:59:46 +10:00
parent fd3b1a04e7
commit c0389b0479
12 changed files with 144 additions and 103 deletions

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "e83f427a65726bfdefd2712a96f228e720c8b274"
echo "e6138a52a907fe4b9b03abe0b6cf6cfb9fbc886b"
}
# Show version information
@ -302,6 +302,7 @@ patch_enable_all ()
enable_user32_ScrollWindowEx="$1"
enable_user32_ShowWindow="$1"
enable_user32_msgbox_Support_WM_COPY_mesg="$1"
enable_user32_rawinput="$1"
enable_user32_recursive_activation="$1"
enable_uxtheme_CloseThemeClass="$1"
enable_uxtheme_GTK_Theming="$1"
@ -1035,6 +1036,9 @@ patch_enable ()
user32-msgbox-Support-WM_COPY-mesg)
enable_user32_msgbox_Support_WM_COPY_mesg="$2"
;;
user32-rawinput)
enable_user32_rawinput="$2"
;;
user32-recursive-activation)
enable_user32_recursive_activation="$2"
;;
@ -6440,6 +6444,44 @@ if test "$enable_user32_msgbox_Support_WM_COPY_mesg" -eq 1; then
) >> "$patchlist"
fi
# Patchset user32-rawinput
# |
# | This patchset fixes the following Wine bugs:
# | * [#42675] - Overwatch - Phantom mouse input / view pulled up to ceiling.
# | * [#45882] - Raw Input should use untransformed mouse values (affects Overwatch, several Source games).
# | * [#47457] - Mouse click-click-hold is treated as double click, causing gun jam in Overwatch.
# | * [#42631] - user32: Add Raw Input support.
# |
# | Modified files:
# | * dlls/user32/input.c, dlls/user32/message.c, dlls/user32/rawinput.c, dlls/user32/user32.spec, dlls/winex11.drv/event.c,
# | dlls/winex11.drv/mouse.c, dlls/winex11.drv/x11drv.h, dlls/winex11.drv/x11drv_main.c, include/winuser.h,
# | server/protocol.def, server/queue.c, server/trace.c, tools/make_requests
# |
if test "$enable_user32_rawinput" -eq 1; then
patch_apply user32-rawinput/0001-user32-Add-support-for-RIDEV_NOLEGACY-flag.patch
patch_apply user32-rawinput/0002-server-Move-mouse-raw-input-message-faking-from-user.patch
patch_apply user32-rawinput/0003-server-Add-request-for-sending-native-raw-input-mess.patch
patch_apply user32-rawinput/0004-user32-Add-helper-for-input-drivers-to-submit-native.patch
patch_apply user32-rawinput/0005-server-Don-t-emulate-rawinput-mouse-events-if-native.patch
patch_apply user32-rawinput/0006-winex11.drv-Directly-listen-to-master-XInput2-device.patch
patch_apply user32-rawinput/0007-winex11.drv-Implement-native-mouse-movement-raw-inpu.patch
patch_apply user32-rawinput/0008-winex11.drv-Implement-native-mouse-button-raw-input-.patch
patch_apply user32-rawinput/0009-winex11.drv-Don-t-react-to-small-slow-mouse-movement.patch
patch_apply user32-rawinput/0010-server-Implement-RIDEV_INPUTSINK-flag.patch
(
printf '%s\n' '+ { "Derek Lesho", "user32: Add support for RIDEV_NOLEGACY flag.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "server: Move mouse raw-input message faking from user32 to wineserver.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "server: Add request for sending native raw-input messages.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "user32: Add helper for input drivers to submit native rawinput msgs.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "server: Don'\''t emulate rawinput mouse events if native exist.", 1 },';
printf '%s\n' '+ { "Rémi Bernon", "winex11.drv: Directly listen to master XInput2 devices if supported.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "winex11.drv: Implement native mouse-movement raw-input using RawMotion.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "winex11.drv: Implement native mouse-button raw-input using RawButton*.", 1 },';
printf '%s\n' '+ { "Jordan Galby", "winex11.drv: Don'\''t react to small slow mouse movements.", 1 },';
printf '%s\n' '+ { "Derek Lesho", "server: Implement RIDEV_INPUTSINK flag.", 1 },';
) >> "$patchlist"
fi
# Patchset user32-recursive-activation
# |
# | This patchset fixes the following Wine bugs:

View File

@ -1,4 +1,4 @@
From 5b72eb081757521ee2f86aad97c36ed751733b1d Mon Sep 17 00:00:00 2001
From 743222b233535c172c4fdba1e878251d3be038e1 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Tue, 25 Jun 2019 16:23:02 -0400
Subject: [PATCH 01/10] user32: Add support for RIDEV_NOLEGACY flag.
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index 49cf9f73a0..58480b8ae7 100644
index 94cf7a9a5d2..661a0e3b255 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -271,7 +271,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
@@ -282,7 +282,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n",
i, devices[i].usUsagePage, devices[i].usUsage,
devices[i].dwFlags, devices[i].hwndTarget);
@ -23,10 +23,10 @@ index 49cf9f73a0..58480b8ae7 100644
d[i].usage_page = devices[i].usUsagePage;
diff --git a/server/queue.c b/server/queue.c
index 96587d11d1..40a566a2b7 100644
index af65b5f6b4c..94c612efb03 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -372,6 +372,9 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y )
@@ -427,6 +427,9 @@ static void set_cursor_pos( struct desktop *desktop, int x, int y )
static const struct hw_msg_source source = { IMDT_UNAVAILABLE, IMO_SYSTEM };
struct message *msg;
@ -36,7 +36,7 @@ index 96587d11d1..40a566a2b7 100644
if (!(msg = alloc_hardware_message( 0, source, get_tick_count() ))) return;
msg->msg = WM_MOUSEMOVE;
@@ -1670,6 +1673,9 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1808,6 +1811,9 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
queue_hardware_message( desktop, msg, 0 );
}
@ -46,7 +46,7 @@ index 96587d11d1..40a566a2b7 100644
for (i = 0; i < ARRAY_SIZE( messages ); i++)
{
if (!messages[i]) continue;
@@ -1795,6 +1801,9 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
@@ -1933,6 +1939,9 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
queue_hardware_message( desktop, msg, 0 );
}
@ -57,5 +57,5 @@ index 96587d11d1..40a566a2b7 100644
msg_data = msg->data;
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From 8cd2c66e39dee6edb4dda9faef5601785a8eb9eb Mon Sep 17 00:00:00 2001
From 06678989a4cdc051fc86cfc93ca9f91f26ea8d3e Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Tue, 25 Jun 2019 20:47:20 -0400
Subject: [PATCH 02/10] server: Move mouse raw-input message faking from user32
@ -12,7 +12,7 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
3 files changed, 52 insertions(+), 49 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c
index 43ce77c2dd..b6dd7d5932 100644
index cc25d2f6c2f..f2442670f44 100644
--- a/dlls/user32/message.c
+++ b/dlls/user32/message.c
@@ -2295,54 +2295,14 @@ static BOOL process_rawinput_message( MSG *msg, const struct hardware_msg_data *
@ -74,10 +74,10 @@ index 43ce77c2dd..b6dd7d5932 100644
rawinput->data.mouse.ulRawButtons = 0;
rawinput->data.mouse.lLastX = msg_data->rawinput.mouse.x;
diff --git a/server/protocol.def b/server/protocol.def
index 8157199f2f..f7e0008b04 100644
index fab68f9d8fe..e7e6b817172 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -304,10 +304,11 @@ struct hardware_msg_data
@@ -316,10 +316,11 @@ struct hardware_msg_data
} kbd;
struct
{
@ -94,10 +94,10 @@ index 8157199f2f..f7e0008b04 100644
} rawinput;
};
diff --git a/server/queue.c b/server/queue.c
index 40a566a2b7..b58dfd5213 100644
index 94c612efb03..7eecd286fab 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1627,6 +1627,16 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1765,6 +1765,16 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
WM_MOUSEHWHEEL /* 0x1000 = MOUSEEVENTF_HWHEEL */
};
@ -114,7 +114,7 @@ index 40a566a2b7..b58dfd5213 100644
desktop->cursor.last_change = get_tick_count();
flags = input->mouse.flags;
time = input->mouse.time;
@@ -1664,11 +1674,43 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1802,11 +1812,43 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
msg->wparam = RIM_INPUT;
msg->lparam = 0;
@ -161,5 +161,5 @@ index 40a566a2b7..b58dfd5213 100644
queue_hardware_message( desktop, msg, 0 );
}
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From c086e4c12e621444c4f1922d4fd48b57423d430d Mon Sep 17 00:00:00 2001
From 0cd4df0e1c8cb9859933b2131568d6da2bea5a9f Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Tue, 25 Jun 2019 21:24:12 -0400
Subject: [PATCH 03/10] server: Add request for sending native raw-input
@ -13,10 +13,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
4 files changed, 101 insertions(+), 19 deletions(-)
diff --git a/server/protocol.def b/server/protocol.def
index f7e0008b04..15cd48bbb5 100644
index e7e6b817172..6fe4f3040ba 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -286,31 +286,38 @@ struct hw_msg_source
@@ -298,31 +298,38 @@ struct hw_msg_source
unsigned int origin; /* source origin (IMO_* values) */
};
@ -74,7 +74,7 @@ index f7e0008b04..15cd48bbb5 100644
};
struct callback_msg_data
@@ -2318,6 +2325,11 @@ enum message_type
@@ -2361,6 +2368,11 @@ enum message_type
#define SEND_HWMSG_INJECTED 0x01
@ -87,10 +87,10 @@ index f7e0008b04..15cd48bbb5 100644
@REQ(get_message)
unsigned int flags; /* PM_* flags */
diff --git a/server/queue.c b/server/queue.c
index b58dfd5213..c61fd28a24 100644
index 7eecd286fab..edd577bcdc7 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -2421,6 +2421,54 @@ DECL_HANDLER(send_hardware_message)
@@ -2564,6 +2564,54 @@ DECL_HANDLER(send_hardware_message)
release_object( desktop );
}
@ -146,7 +146,7 @@ index b58dfd5213..c61fd28a24 100644
DECL_HANDLER(post_quit_message)
{
diff --git a/server/trace.c b/server/trace.c
index 0df649ea29..d849d89772 100644
index 9078acd0867..5973bbe36f4 100644
--- a/server/trace.c
+++ b/server/trace.c
@@ -405,6 +405,27 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input )
@ -178,7 +178,7 @@ index 0df649ea29..d849d89772 100644
{
fprintf( stderr, "%s%d.%u", prefix, luid->high_part, luid->low_part );
diff --git a/tools/make_requests b/tools/make_requests
index faeabe5852..8b1f1a263b 100755
index faeabe5852d..8b1f1a263b9 100755
--- a/tools/make_requests
+++ b/tools/make_requests
@@ -53,6 +53,7 @@ my %formats =
@ -190,5 +190,5 @@ index faeabe5852..8b1f1a263b 100755
my @requests = ();
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From 4e45880cdd3493507dbc26f840dbe96dc089f032 Mon Sep 17 00:00:00 2001
From 507b928e640284dd7a3e83ab974a25eeaeee25e8 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Tue, 25 Jun 2019 21:28:54 -0400
Subject: [PATCH 04/10] user32: Add helper for input drivers to submit native
@ -12,7 +12,7 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
3 files changed, 32 insertions(+)
diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 8b2ae805aa..f3f5646a4c 100644
index a45d7fe90a9..e05f436005f 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -33,6 +33,7 @@
@ -60,7 +60,7 @@ index 8b2ae805aa..f3f5646a4c 100644
/***********************************************************************
* update_mouse_coords
diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec
index f9a4ae26df..3311dcd685 100644
index 6d70df366eb..49df59572fe 100644
--- a/dlls/user32/user32.spec
+++ b/dlls/user32/user32.spec
@@ -833,4 +833,5 @@
@ -70,7 +70,7 @@ index f9a4ae26df..3311dcd685 100644
+@ cdecl __wine_send_raw_input(ptr)
@ cdecl __wine_set_pixel_format(long long)
diff --git a/include/winuser.h b/include/winuser.h
index 51c73d25c2..259db275c4 100644
index 51c73d25c2f..259db275c49 100644
--- a/include/winuser.h
+++ b/include/winuser.h
@@ -4390,6 +4390,7 @@ WORD WINAPI SYSTEM_KillSystemTimer( WORD );
@ -82,5 +82,5 @@ index 51c73d25c2..259db275c4 100644
#ifdef __cplusplus
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From ac1dd32eca67140548a27b40904cccd56c785d7d Mon Sep 17 00:00:00 2001
From 82c8cec6e0f28592603b9b66402178422497f9db Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Tue, 25 Jun 2019 21:58:34 -0400
Subject: [PATCH 05/10] server: Don't emulate rawinput mouse events if native
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/server/queue.c b/server/queue.c
index c61fd28a24..e540fd0a64 100644
index edd577bcdc7..7ddee7c91ed 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1599,6 +1599,8 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa
@@ -1737,6 +1737,8 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa
return 1;
}
@ -22,7 +22,7 @@ index c61fd28a24..e540fd0a64 100644
/* queue a hardware message for a mouse event */
static int queue_mouse_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input,
unsigned int origin, struct msg_queue *sender )
@@ -1664,7 +1666,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1802,7 +1804,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
y = desktop->cursor.y;
}
@ -32,7 +32,7 @@ index c61fd28a24..e540fd0a64 100644
{
if (!(msg = alloc_hardware_message( input->mouse.info, source, time ))) return 0;
msg_data = msg->data;
@@ -2435,6 +2438,7 @@ DECL_HANDLER(send_rawinput_message)
@@ -2578,6 +2581,7 @@ DECL_HANDLER(send_rawinput_message)
switch (req->input.type)
{
case RIM_TYPEMOUSE:
@ -41,5 +41,5 @@ index c61fd28a24..e540fd0a64 100644
{
struct thread *thread = device->target ? get_window_thread( device->target ) : NULL;
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From b33da9582fa3d8a6bd761abf72542d24a10fb948 Mon Sep 17 00:00:00 2001
From 6e594b2977c582dad95043512ab2828cc2dee52e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Tue, 23 Jul 2019 14:10:44 +0200
Subject: [PATCH 06/10] winex11.drv: Directly listen to master XInput2 devices
@ -21,10 +21,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
2 files changed, 42 insertions(+), 56 deletions(-)
diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 5c465aa033..1e64f0d2a3 100644
index 6b604fc9f15..e1da2b62148 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -271,46 +271,6 @@ enum event_merge_action
@@ -274,46 +274,6 @@ enum event_merge_action
MERGE_IGNORE /* ignore the new event, keep the old one */
};
@ -71,7 +71,7 @@ index 5c465aa033..1e64f0d2a3 100644
/***********************************************************************
* merge_events
*
@@ -362,7 +322,7 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
@@ -365,7 +325,7 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
if (next->xcookie.extension != xinput2_opcode) break;
if (next->xcookie.evtype != XI_RawMotion) break;
if (x11drv_thread_data()->warp_serial) break;
@ -81,10 +81,10 @@ index 5c465aa033..1e64f0d2a3 100644
}
break;
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index f737a306a5..578efa1931 100644
index 3c49762cee4..d55e208490e 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -130,6 +130,8 @@ static Cursor create_cursor( HANDLE handle );
@@ -133,6 +133,8 @@ static Cursor create_cursor( HANDLE handle );
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
static BOOL xinput2_available;
@ -93,7 +93,7 @@ index f737a306a5..578efa1931 100644
static BOOL broken_rawevents;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f
MAKE_FUNCPTR(XIGetClientPointer);
@@ -301,8 +303,11 @@ static void enable_xinput2(void)
@@ -304,8 +306,11 @@ static void enable_xinput2(void)
if (data->xi2_state == xi_unknown)
{
@ -107,7 +107,7 @@ index f737a306a5..578efa1931 100644
else
{
data->xi2_state = xi_unavailable;
@@ -314,12 +319,20 @@ static void enable_xinput2(void)
@@ -317,12 +322,20 @@ static void enable_xinput2(void)
mask.mask = mask_bits;
mask.mask_len = sizeof(mask_bits);
@ -130,7 +130,7 @@ index f737a306a5..578efa1931 100644
pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 );
pointer_info = pXIQueryDevice( data->display, data->xi2_core_pointer, &count );
@@ -333,7 +346,7 @@ static void enable_xinput2(void)
@@ -336,7 +349,7 @@ static void enable_xinput2(void)
* safe to be obtained statically at enable_xinput2() time.
*/
if (data->xi2_devices) pXIFreeDeviceInfo( data->xi2_devices );
@ -139,7 +139,7 @@ index f737a306a5..578efa1931 100644
data->xi2_current_slave = 0;
data->xi2_state = xi_enabled;
@@ -356,7 +369,13 @@ static void disable_xinput2(void)
@@ -359,7 +372,13 @@ static void disable_xinput2(void)
mask.mask = NULL;
mask.mask_len = 0;
@ -154,7 +154,7 @@ index f737a306a5..578efa1931 100644
pXISelectEvents( data->display, DefaultRootWindow( data->display ), &mask, 1 );
pXIFreeDeviceInfo( data->xi2_devices );
@@ -1735,25 +1754,32 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1823,25 +1842,32 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
if (!event->valuators.mask_len) return FALSE;
if (thread_data->xi2_state != xi_enabled) return FALSE;
@ -197,5 +197,5 @@ index f737a306a5..578efa1931 100644
x_rel = &thread_data->x_rel_valuator;
y_rel = &thread_data->y_rel_valuator;
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From 81a576cc51c02c93a20bf874052be30c8de2d950 Mon Sep 17 00:00:00 2001
From f270475e7fe23001af3f19d918f290783823be63 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Tue, 25 Jun 2019 22:37:34 -0400
Subject: [PATCH 07/10] winex11.drv: Implement native mouse-movement raw-input
@ -12,10 +12,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
3 files changed, 58 insertions(+), 16 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 578efa1931..26d5e6a575 100644
index d55e208490e..1ec077bca74 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -288,9 +288,9 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
@@ -291,9 +291,9 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
/***********************************************************************
@ -27,7 +27,7 @@ index 578efa1931..26d5e6a575 100644
{
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
struct x11drv_thread_data *data = x11drv_thread_data();
@@ -322,7 +322,6 @@ static void enable_xinput2(void)
@@ -325,7 +325,6 @@ static void enable_xinput2(void)
mask.deviceid = XIAllMasterDevices;
memset( mask_bits, 0, sizeof(mask_bits) );
XISetMask( mask_bits, XI_RawMotion );
@ -35,7 +35,7 @@ index 578efa1931..26d5e6a575 100644
/* XInput 2.0 has a problematic behavior where master pointer will
* not send raw events to the root window whenever a grab is active
@@ -354,15 +353,15 @@ static void enable_xinput2(void)
@@ -357,15 +356,15 @@ static void enable_xinput2(void)
}
/***********************************************************************
@ -54,7 +54,7 @@ index 578efa1931..26d5e6a575 100644
TRACE( "disabling\n" );
data->xi2_state = xi_disabled;
@@ -387,6 +386,21 @@ static void disable_xinput2(void)
@@ -390,6 +389,21 @@ static void disable_xinput2(void)
#endif
}
@ -76,8 +76,8 @@ index 578efa1931..26d5e6a575 100644
/***********************************************************************
* grab_clipping_window
@@ -412,9 +426,9 @@ static BOOL grab_clipping_window( const RECT *clip )
return TRUE;
@@ -428,9 +442,9 @@ static BOOL grab_clipping_window( const RECT *clip )
}
/* enable XInput2 unless we are already clipping */
- if (!data->clip_hwnd) enable_xinput2();
@ -88,7 +88,7 @@ index 578efa1931..26d5e6a575 100644
{
WARN( "XInput2 not supported, refusing to clip to %s\n", wine_dbgstr_rect(clip) );
DestroyWindow( msg_hwnd );
@@ -442,7 +456,7 @@ static BOOL grab_clipping_window( const RECT *clip )
@@ -458,7 +472,7 @@ static BOOL grab_clipping_window( const RECT *clip )
if (!clipping_cursor)
{
@ -97,7 +97,7 @@ index 578efa1931..26d5e6a575 100644
DestroyWindow( msg_hwnd );
return FALSE;
}
@@ -508,7 +522,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND new_clip_hwnd )
@@ -539,7 +553,7 @@ LRESULT clip_cursor_notify( HWND hwnd, HWND prev_clip_hwnd, HWND new_clip_hwnd )
TRACE( "clip hwnd reset from %p\n", hwnd );
data->clip_hwnd = 0;
data->clip_reset = GetTickCount();
@ -106,7 +106,7 @@ index 578efa1931..26d5e6a575 100644
DestroyWindow( hwnd );
}
else if (hwnd == GetForegroundWindow()) /* request to clip */
@@ -1743,16 +1757,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1831,16 +1845,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
{
XIRawEvent *event = xev->data;
const double *values = event->valuators.values;
@ -127,7 +127,7 @@ index 578efa1931..26d5e6a575 100644
if (xinput2_version_major == 2 && xinput2_version_minor == 0)
{
@@ -1784,6 +1800,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1872,6 +1888,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
x_rel = &thread_data->x_rel_valuator;
y_rel = &thread_data->y_rel_valuator;
@ -135,7 +135,7 @@ index 578efa1931..26d5e6a575 100644
input.u.mi.mouseData = 0;
input.u.mi.dwFlags = MOUSEEVENTF_MOVE;
input.u.mi.time = EVENT_x11_time_to_win32_time( event->time );
@@ -1791,18 +1808,30 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1879,18 +1896,30 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.u.mi.dx = 0;
input.u.mi.dy = 0;
@ -166,7 +166,7 @@ index 578efa1931..26d5e6a575 100644
}
if (i == y_rel->number)
{
@@ -1810,6 +1839,8 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1898,6 +1927,8 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
if (y_rel->min < y_rel->max)
input.u.mi.dy = val * (virtual_rect.bottom - virtual_rect.top)
/ (y_rel->max - y_rel->min);
@ -175,7 +175,7 @@ index 578efa1931..26d5e6a575 100644
}
}
@@ -1819,10 +1850,15 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1907,10 +1938,15 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
return FALSE;
}
@ -195,7 +195,7 @@ index 578efa1931..26d5e6a575 100644
}
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 0d3695bdcf..2223629c7b 100644
index 68ef1881a45..81ad38df918 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -194,6 +194,8 @@ extern BOOL CDECL X11DRV_UnrealizePalette( HPALETTE hpal ) DECLSPEC_HIDDEN;
@ -207,7 +207,7 @@ index 0d3695bdcf..2223629c7b 100644
extern DWORD copy_image_bits( BITMAPINFO *info, BOOL is_r8g8b8, XImage *image,
const struct gdi_image_bits *src_bits, struct gdi_image_bits *dst_bits,
@@ -335,7 +337,7 @@ struct x11drv_thread_data
@@ -337,7 +339,7 @@ struct x11drv_thread_data
HWND clip_hwnd; /* message window stored in desktop while clipping is active */
DWORD clip_reset; /* time when clipping was last reset */
HKL kbd_layout; /* active keyboard layout */
@ -217,10 +217,10 @@ index 0d3695bdcf..2223629c7b 100644
int xi2_device_count;
struct x11drv_valuator_data x_rel_valuator;
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 21807af3f1..214c101b67 100644
index 0120ca06a20..cfcf1f19dd1 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -611,6 +611,8 @@ void CDECL X11DRV_ThreadDetach(void)
@@ -616,6 +616,8 @@ void CDECL X11DRV_ThreadDetach(void)
if (data)
{
@ -229,7 +229,7 @@ index 21807af3f1..214c101b67 100644
if (data->xim) XCloseIM( data->xim );
if (data->font_set) XFreeFontSet( data->display, data->font_set );
XCloseDisplay( data->display );
@@ -681,6 +683,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
@@ -689,6 +691,8 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
if (use_xim) X11DRV_SetupXIM();
@ -239,5 +239,5 @@ index 21807af3f1..214c101b67 100644
}
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From b187bccf25714eb5cde3e785e52aba2166f0bbec Mon Sep 17 00:00:00 2001
From cd40a026040d5f981e2dc3051826befa3d5df8f6 Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Fri, 26 Jul 2019 17:37:19 -0400
Subject: [PATCH 08/10] winex11.drv: Implement native mouse-button raw-input
@ -12,10 +12,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
3 files changed, 87 insertions(+), 5 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 26d5e6a575..df60c41e61 100644
index 1ec077bca74..6e09bebfdb8 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -259,6 +259,7 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
@@ -262,6 +262,7 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
thread_data->x_rel_valuator.number = -1;
thread_data->y_rel_valuator.number = -1;
@ -23,7 +23,7 @@ index 26d5e6a575..df60c41e61 100644
for (i = 0; i < n_valuators; i++)
{
@@ -276,6 +277,11 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
@@ -279,6 +280,11 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
{
valuator_data = &thread_data->y_rel_valuator;
}
@ -35,7 +35,7 @@ index 26d5e6a575..df60c41e61 100644
if (valuator_data) {
valuator_data->number = class->number;
@@ -322,6 +328,8 @@ void X11DRV_XInput2_Enable(void)
@@ -325,6 +331,8 @@ void X11DRV_XInput2_Enable(void)
mask.deviceid = XIAllMasterDevices;
memset( mask_bits, 0, sizeof(mask_bits) );
XISetMask( mask_bits, XI_RawMotion );
@ -44,7 +44,7 @@ index 26d5e6a575..df60c41e61 100644
/* XInput 2.0 has a problematic behavior where master pointer will
* not send raw events to the root window whenever a grab is active
@@ -380,6 +388,7 @@ void X11DRV_XInput2_Disable(void)
@@ -383,6 +391,7 @@ void X11DRV_XInput2_Disable(void)
pXIFreeDeviceInfo( data->xi2_devices );
data->x_rel_valuator.number = -1;
data->y_rel_valuator.number = -1;
@ -52,7 +52,7 @@ index 26d5e6a575..df60c41e61 100644
data->xi2_devices = NULL;
data->xi2_core_pointer = 0;
data->xi2_current_slave = 0;
@@ -1762,11 +1771,11 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1850,11 +1859,11 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
INPUT input;
RAWINPUT raw_input;
int i;
@ -67,7 +67,7 @@ index 26d5e6a575..df60c41e61 100644
if (!event->valuators.mask_len) return FALSE;
if (thread_data->xi2_state < xi_enabled) return FALSE;
@@ -1799,6 +1808,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1887,6 +1896,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
x_rel = &thread_data->x_rel_valuator;
y_rel = &thread_data->y_rel_valuator;
@ -75,7 +75,7 @@ index 26d5e6a575..df60c41e61 100644
input.type = INPUT_MOUSE;
input.u.mi.mouseData = 0;
@@ -1819,7 +1829,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1907,7 +1917,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
virtual_rect = get_virtual_screen_rect();
@ -84,7 +84,7 @@ index 26d5e6a575..df60c41e61 100644
{
if (!XIMaskIsSet( event->valuators.mask, i )) continue;
val = *values++;
@@ -1842,6 +1852,13 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1930,6 +1940,13 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
raw_input.data.mouse.lLastY = raw_dy = raw_val;
}
@ -98,7 +98,7 @@ index 26d5e6a575..df60c41e61 100644
}
if (broken_rawevents && is_old_motion_event( xev->serial ))
@@ -1856,12 +1873,69 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1944,12 +1961,69 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
__wine_send_input( 0, &input );
}
@ -169,7 +169,7 @@ index 26d5e6a575..df60c41e61 100644
#endif /* HAVE_X11_EXTENSIONS_XINPUT2_H */
@@ -1926,6 +2000,11 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
@@ -2014,6 +2088,11 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
case XI_RawMotion:
ret = X11DRV_RawMotion( event );
break;
@ -182,10 +182,10 @@ index 26d5e6a575..df60c41e61 100644
default:
TRACE( "Unhandled event %#x\n", event->evtype );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 2223629c7b..c74f1493c0 100644
index 81ad38df918..7a9b2c8b909 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -342,6 +342,7 @@ struct x11drv_thread_data
@@ -344,6 +344,7 @@ struct x11drv_thread_data
int xi2_device_count;
struct x11drv_valuator_data x_rel_valuator;
struct x11drv_valuator_data y_rel_valuator;
@ -193,7 +193,7 @@ index 2223629c7b..c74f1493c0 100644
int xi2_core_pointer; /* XInput2 core pointer id */
int xi2_current_slave; /* Current slave driving the Core pointer */
};
@@ -427,6 +428,7 @@ enum x11drv_atoms
@@ -431,6 +432,7 @@ enum x11drv_atoms
XATOM_RAW_CAP_HEIGHT,
XATOM_Rel_X,
XATOM_Rel_Y,
@ -202,10 +202,10 @@ index 2223629c7b..c74f1493c0 100644
XATOM_WM_DELETE_WINDOW,
XATOM_WM_STATE,
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 214c101b67..86b6efac08 100644
index cfcf1f19dd1..093a5fa785e 100644
--- a/dlls/winex11.drv/x11drv_main.c
+++ b/dlls/winex11.drv/x11drv_main.c
@@ -120,6 +120,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
@@ -121,6 +121,7 @@ static const char * const atom_names[NB_XATOMS - FIRST_XATOM] =
"RAW_CAP_HEIGHT",
"Rel X",
"Rel Y",
@ -214,5 +214,5 @@ index 214c101b67..86b6efac08 100644
"WM_DELETE_WINDOW",
"WM_STATE",
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From 4d2c65f23588f7953f93ab1426bc88e0bdc977a2 Mon Sep 17 00:00:00 2001
From c2c9aa68949b930f329c9d9a21327ea509e0dd66 Mon Sep 17 00:00:00 2001
From: Jordan Galby <gravemind2a+wine@gmail.com>
Date: Tue, 16 Jul 2019 00:34:38 -0400
Subject: [PATCH 09/10] winex11.drv: Don't react to small slow mouse movements.
@ -12,10 +12,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
2 files changed, 42 insertions(+), 10 deletions(-)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index df60c41e61..6df473e548 100644
index 6e09bebfdb8..ecab4530457 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -261,6 +261,10 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
@@ -264,6 +264,10 @@ static void update_relative_valuators(XIAnyClassInfo **valuators, int n_valuator
thread_data->y_rel_valuator.number = -1;
thread_data->wheel_valuator.number = -1;
@ -26,7 +26,7 @@ index df60c41e61..6df473e548 100644
for (i = 0; i < n_valuators; i++)
{
XIValuatorClassInfo *class = (XIValuatorClassInfo *)valuators[i];
@@ -1836,18 +1840,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1924,18 +1928,18 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
raw_val = *raw_values++;
if (i == x_rel->number)
{
@ -49,7 +49,7 @@ index df60c41e61..6df473e548 100644
/ (y_rel->max - y_rel->min);
raw_input.data.mouse.lLastY = raw_dy = raw_val;
@@ -1863,20 +1867,47 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -1951,20 +1955,47 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
if (broken_rawevents && is_old_motion_event( xev->serial ))
{
@ -104,10 +104,10 @@ index df60c41e61..6df473e548 100644
TRACE("raw event %f,%f + %f\n", raw_dx, raw_dy, raw_dwheel);
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index c74f1493c0..8a59874251 100644
index 7a9b2c8b909..b47019d299e 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -320,6 +320,7 @@ struct x11drv_valuator_data
@@ -321,6 +321,7 @@ struct x11drv_valuator_data
double min;
double max;
int number;
@ -116,5 +116,5 @@ index c74f1493c0..8a59874251 100644
struct x11drv_thread_data
--
2.23.0
2.17.1

View File

@ -1,4 +1,4 @@
From 0f75495249bd3b4a78daab8efde1421602f8062d Mon Sep 17 00:00:00 2001
From 2269a833a000d6b0ea2ffbab2c92f6aa0e0918ab Mon Sep 17 00:00:00 2001
From: Derek Lesho <dereklesho52@Gmail.com>
Date: Sat, 10 Aug 2019 12:20:59 -0400
Subject: [PATCH 10/10] server: Implement RIDEV_INPUTSINK flag
@ -10,10 +10,10 @@ Signed-off-by: Derek Lesho <dereklesho52@Gmail.com>
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/rawinput.c b/dlls/user32/rawinput.c
index 58480b8ae7..c231e2059c 100644
index 661a0e3b255..a93dc365006 100644
--- a/dlls/user32/rawinput.c
+++ b/dlls/user32/rawinput.c
@@ -271,7 +271,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
@@ -282,7 +282,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(RAWINPUTDEVICE *devices, U
TRACE("device %u: page %#x, usage %#x, flags %#x, target %p.\n",
i, devices[i].usUsagePage, devices[i].usUsage,
devices[i].dwFlags, devices[i].hwndTarget);
@ -23,10 +23,10 @@ index 58480b8ae7..c231e2059c 100644
d[i].usage_page = devices[i].usUsagePage;
diff --git a/server/queue.c b/server/queue.c
index e540fd0a64..c76b18afcd 100644
index 7ddee7c91ed..1a2a2d1b5d2 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -2442,7 +2442,9 @@ DECL_HANDLER(send_rawinput_message)
@@ -2585,7 +2585,9 @@ DECL_HANDLER(send_rawinput_message)
if ((device = current->process->rawinput_mouse))
{
struct thread *thread = device->target ? get_window_thread( device->target ) : NULL;
@ -38,5 +38,5 @@ index e540fd0a64..c76b18afcd 100644
if (!(msg = alloc_hardware_message( 0, source, 0 ))) goto done;
--
2.23.0
2.17.1

View File

@ -2,5 +2,4 @@ Fixes: [42675] - Overwatch - Phantom mouse input / view pulled up to ceiling.
Fixes: [45882] - Raw Input should use untransformed mouse values (affects Overwatch, several Source games).
Fixes: [47457] - Mouse click-click-hold is treated as double click, causing gun jam in Overwatch.
Fixes: [42631] - user32: Add Raw Input support.
Disabled: True