Rebase against 10765f2956d6f9fc2d16bb2bec476b12a31786f6.

This commit is contained in:
Alistair Leslie-Hughes
2023-03-03 11:22:41 +11:00
parent f7b671178c
commit cd22a0fb15
6 changed files with 63 additions and 63 deletions

View File

@@ -1,4 +1,4 @@
From b3e1675f4654daecf5237f86a6bfa5d3512c109c Mon Sep 17 00:00:00 2001
From f13bfd6f599ae272f698bb06491d689bd6d5d142 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 26 Aug 2019 14:37:20 +0200
Subject: [PATCH] server: Add send_hardware_message flags for rawinput
@@ -11,31 +11,31 @@ Subject: [PATCH] server: Add send_hardware_message flags for rawinput
3 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index 74cfec0651a..fbdd09ad806 100644
index ad3d8e85cd2..bad69c18142 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -1912,6 +1912,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
@@ -2627,6 +2627,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
req->input.mouse.flags = input->mi.dwFlags;
req->input.mouse.time = input->mi.time;
req->input.mouse.info = input->mi.dwExtraInfo;
+ req->flags |= SEND_HWMSG_RAWINPUT;
break;
case INPUT_KEYBOARD:
req->input.kbd.vkey = input->ki.wVk;
@@ -1919,6 +1920,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
affects_key_state = !!(input->mi.dwFlags & (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP |
MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP |
MOUSEEVENTF_MIDDLEDOWN | MOUSEEVENTF_MIDDLEUP |
@@ -2638,6 +2639,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
req->input.kbd.flags = input->ki.dwFlags;
req->input.kbd.time = input->ki.time;
req->input.kbd.info = input->ki.dwExtraInfo;
+ req->flags |= SEND_HWMSG_RAWINPUT;
affects_key_state = TRUE;
break;
case INPUT_HARDWARE:
req->input.hw.msg = input->hi.uMsg;
diff --git a/server/protocol.def b/server/protocol.def
index 673fcdd6c8d..0c1b6b57518 100644
index a4660a21aca..9e6ba5317fd 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -2041,6 +2041,7 @@ enum message_type
VARARG(keystate,bytes); /* global state array for all the keys */
@@ -2082,6 +2082,7 @@ enum message_type
int new_y;
@END
#define SEND_HWMSG_INJECTED 0x01
+#define SEND_HWMSG_RAWINPUT 0x02
@@ -43,10 +43,10 @@ index 673fcdd6c8d..0c1b6b57518 100644
/* Get a message from the current queue */
diff --git a/server/queue.c b/server/queue.c
index e11e24378e6..950a2cdce22 100644
index 61cbeec75dd..f5dbe0e733e 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1815,7 +1815,7 @@ done:
@@ -1794,7 +1794,7 @@ done:
/* 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,
@@ -55,7 +55,7 @@ index e11e24378e6..950a2cdce22 100644
{
const struct rawinput_device *device;
struct hardware_msg_data *msg_data;
@@ -1870,7 +1870,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1849,7 +1849,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
y = desktop->cursor.y;
}
@@ -64,7 +64,7 @@ index e11e24378e6..950a2cdce22 100644
{
memset( &raw_msg, 0, sizeof(raw_msg) );
raw_msg.foreground = foreground;
@@ -1929,7 +1929,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
@@ -1908,7 +1908,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
/* queue a hardware message for a keyboard event */
static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, const hw_input_t *input,
@@ -73,7 +73,7 @@ index e11e24378e6..950a2cdce22 100644
{
struct hw_msg_source source = { IMDT_KEYBOARD, origin };
const struct rawinput_device *device;
@@ -2007,7 +2007,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
@@ -1986,7 +1986,7 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
break;
}
@@ -82,7 +82,7 @@ index e11e24378e6..950a2cdce22 100644
{
memset( &raw_msg, 0, sizeof(raw_msg) );
raw_msg.foreground = foreground;
@@ -2641,10 +2641,10 @@ DECL_HANDLER(send_hardware_message)
@@ -2617,10 +2617,10 @@ DECL_HANDLER(send_hardware_message)
switch (req->input.type)
{
case INPUT_MOUSE:
@@ -96,5 +96,5 @@ index e11e24378e6..950a2cdce22 100644
case INPUT_HARDWARE:
queue_custom_hardware_message( desktop, req->win, origin, &req->input );
--
2.35.1
2.39.2

View File

@@ -1,4 +1,4 @@
From b2f68f427f6fc486238b768c664ed6df6009a5ef Mon Sep 17 00:00:00 2001
From aabf00b3648c3ac7573d2ddffdb95bb98aed2616 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Wed, 24 Mar 2021 23:29:28 +0100
Subject: [PATCH] user32: Set SEND_HWMSG_RAWINPUT flags only when RAWINPUT is
@@ -20,7 +20,7 @@ __wine_send_input with INPUT_HARDWARE input type and a rawinput.
9 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index afd352e1fbd..2442aa49053 100644
index a8b938066ff..b89869b141c 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -613,6 +613,7 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size )
@@ -41,27 +41,27 @@ index afd352e1fbd..2442aa49053 100644
case INPUT_HARDWARE:
RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index 56a23a95e71..7b0004dfb96 100644
index bad69c18142..3c4c12d1c7f 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -2623,7 +2623,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
@@ -2627,7 +2627,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
req->input.mouse.flags = input->mi.dwFlags;
req->input.mouse.time = input->mi.time;
req->input.mouse.info = input->mi.dwExtraInfo;
- req->flags |= SEND_HWMSG_RAWINPUT;
+ if (rawinput) req->flags |= SEND_HWMSG_RAWINPUT;
break;
case INPUT_KEYBOARD:
req->input.kbd.vkey = input->ki.wVk;
@@ -2631,7 +2631,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
affects_key_state = !!(input->mi.dwFlags & (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP |
MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP |
MOUSEEVENTF_MIDDLEDOWN | MOUSEEVENTF_MIDDLEUP |
@@ -2639,7 +2639,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
req->input.kbd.flags = input->ki.dwFlags;
req->input.kbd.time = input->ki.time;
req->input.kbd.info = input->ki.dwExtraInfo;
- req->flags |= SEND_HWMSG_RAWINPUT;
+ if (rawinput) req->flags |= SEND_HWMSG_RAWINPUT;
affects_key_state = TRUE;
break;
case INPUT_HARDWARE:
req->input.hw.msg = input->hi.uMsg;
diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c
index 7c55c481353..9a20daf8809 100644
--- a/dlls/wineandroid.drv/keyboard.c
@@ -84,7 +84,7 @@ index 7c55c481353..9a20daf8809 100644
/***********************************************************************
diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index a339c20ceda..222751abc29 100644
index f01df37a400..eb96300da89 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -424,6 +424,7 @@ static int process_events( DWORD mask )
@@ -189,10 +189,10 @@ index cb194095d55..74c329488c4 100644
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 5b1b892de32..622024dcdd9 100644
index 5d02da68313..0a74a7c603d 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1134,6 +1134,7 @@ static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e)
@@ -1123,6 +1123,7 @@ static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e)
*/
static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT flags, UINT time )
{
@@ -200,7 +200,7 @@ index 5b1b892de32..622024dcdd9 100644
INPUT input;
TRACE_(key)( "hwnd %p vkey=%04x scan=%04x flags=%04x\n", hwnd, vkey, scan, flags );
@@ -1145,7 +1146,7 @@ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT fl
@@ -1134,7 +1135,7 @@ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT fl
input.u.ki.time = time;
input.u.ki.dwExtraInfo = 0;
@@ -210,10 +210,10 @@ index 5b1b892de32..622024dcdd9 100644
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 82a82032957..17e88f87982 100644
index e25b3e7728a..bb9807bf850 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -750,6 +750,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -749,6 +749,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
{
struct x11drv_win_data *data;
Window win = 0;
@@ -221,7 +221,7 @@ index 82a82032957..17e88f87982 100644
input->type = INPUT_MOUSE;
@@ -766,7 +767,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -765,7 +766,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
sync_window_cursor( window );
last_cursor_change = input->u.mi.time;
}
@@ -230,7 +230,7 @@ index 82a82032957..17e88f87982 100644
return;
}
@@ -807,7 +808,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -806,7 +807,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
SERVER_END_REQ;
}
@@ -239,7 +239,7 @@ index 82a82032957..17e88f87982 100644
}
#ifdef SONAME_LIBXCURSOR
@@ -1790,6 +1791,7 @@ void move_resize_window( HWND hwnd, int dir )
@@ -1789,6 +1790,7 @@ void move_resize_window( HWND hwnd, int dir )
{
MSG msg;
INPUT input;
@@ -247,7 +247,7 @@ index 82a82032957..17e88f87982 100644
int x, y, rootX, rootY;
if (!XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &x, &y, &xstate )) break;
@@ -1805,7 +1807,7 @@ void move_resize_window( HWND hwnd, int dir )
@@ -1804,7 +1806,7 @@ void move_resize_window( HWND hwnd, int dir )
input.u.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.u.mi.time = NtGetTickCount();
input.u.mi.dwExtraInfo = 0;
@@ -256,7 +256,7 @@ index 82a82032957..17e88f87982 100644
}
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
@@ -2018,6 +2020,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -2017,6 +2019,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
{
XIRawEvent *event = xev->data;
@@ -264,7 +264,7 @@ index 82a82032957..17e88f87982 100644
INPUT input;
if (broken_rawevents && is_old_motion_event( xev->serial ))
@@ -2035,7 +2038,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
@@ -2034,7 +2037,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.u.mi.dy = 0;
if (!map_raw_event_coords( event, &input )) return FALSE;
@@ -274,5 +274,5 @@ index 82a82032957..17e88f87982 100644
}
--
2.39.1
2.39.2