Rebase against 900dfca3899d52f3085c713e26af06aa5aea37a4.

This commit is contained in:
Alistair Leslie-Hughes
2023-07-18 11:18:33 +10:00
parent 4482bd3493
commit 6b7e43830c
6 changed files with 105 additions and 126 deletions

View File

@@ -1,4 +1,4 @@
From 89e3ab4eceaa473697590e2264b0a1d7ccd149f4 Mon Sep 17 00:00:00 2001
From 563e36d041a509b71fb7f889dee52dee151a7442 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
@@ -19,7 +19,7 @@ __wine_send_input with INPUT_HARDWARE input type and a rawinput.
8 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index 5d78b35dd60..cbdd4b195d3 100644
index 7eb8e59a5fb..53fec064842 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -655,6 +655,7 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size )
@@ -40,10 +40,10 @@ index 5d78b35dd60..cbdd4b195d3 100644
case INPUT_HARDWARE:
RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED );
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
index f47154d701a..00ed06abbdf 100644
index 179b801a9f8..3fb36f4762c 100644
--- a/dlls/win32u/message.c
+++ b/dlls/win32u/message.c
@@ -2632,7 +2632,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
@@ -2669,7 +2669,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;
@@ -52,7 +52,7 @@ index f47154d701a..00ed06abbdf 100644
affects_key_state = !!(input->mi.dwFlags & (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP |
MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP |
MOUSEEVENTF_MIDDLEDOWN | MOUSEEVENTF_MIDDLEUP |
@@ -2644,7 +2644,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
@@ -2681,7 +2681,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;
@@ -62,20 +62,20 @@ index f47154d701a..00ed06abbdf 100644
break;
case INPUT_HARDWARE:
diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c
index 7c55c481353..9a20daf8809 100644
index 9f369094949..1606afb3f86 100644
--- a/dlls/wineandroid.drv/keyboard.c
+++ b/dlls/wineandroid.drv/keyboard.c
@@ -674,6 +674,7 @@ static BOOL get_async_key_state( BYTE state[256] )
@@ -671,6 +671,7 @@ static BOOL get_async_key_state( BYTE state[256] )
static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags )
{
+ RAWINPUT rawinput;
INPUT input;
input.type = INPUT_KEYBOARD;
@@ -683,7 +684,7 @@ static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags )
input.u.ki.time = 0;
input.u.ki.dwExtraInfo = 0;
input.type = INPUT_KEYBOARD;
@@ -680,7 +681,7 @@ static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags )
input.ki.time = 0;
input.ki.dwExtraInfo = 0;
- __wine_send_input( hwnd, &input, NULL );
+ __wine_send_input( hwnd, &input, &rawinput );
@@ -83,10 +83,10 @@ index 7c55c481353..9a20daf8809 100644
/***********************************************************************
diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c
index 3a61a2d44d9..a94183f46bf 100644
index d62a2c53909..47a424b40b8 100644
--- a/dlls/wineandroid.drv/window.c
+++ b/dlls/wineandroid.drv/window.c
@@ -424,6 +424,7 @@ static int process_events( DWORD mask )
@@ -421,6 +421,7 @@ static int process_events( DWORD mask )
DPI_AWARENESS_CONTEXT context;
struct java_event *event, *next, *previous;
unsigned int count = 0;
@@ -94,7 +94,7 @@ index 3a61a2d44d9..a94183f46bf 100644
assert( GetCurrentThreadId() == desktop_tid );
@@ -517,7 +518,7 @@ static int process_events( DWORD mask )
@@ -514,7 +515,7 @@ static int process_events( DWORD mask )
}
SERVER_END_REQ;
}
@@ -103,10 +103,10 @@ index 3a61a2d44d9..a94183f46bf 100644
}
break;
@@ -531,7 +532,7 @@ static int process_events( DWORD mask )
event->data.kbd.input.u.ki.wVk, event->data.kbd.input.u.ki.wVk,
event->data.kbd.input.u.ki.wScan );
update_keyboard_lock_state( event->data.kbd.input.u.ki.wVk, event->data.kbd.lock_state );
@@ -528,7 +529,7 @@ static int process_events( DWORD mask )
event->data.kbd.input.ki.wVk, event->data.kbd.input.ki.wVk,
event->data.kbd.input.ki.wScan );
update_keyboard_lock_state( event->data.kbd.input.ki.wVk, event->data.kbd.lock_state );
- __wine_send_input( 0, &event->data.kbd.input, NULL );
+ __wine_send_input( 0, &event->data.kbd.input, &rawinput );
break;
@@ -155,10 +155,10 @@ index 5c04c71e1dc..260831c44dc 100644
diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c
index 83169a9bb4d..ecd513ee2a4 100644
index b54ca795954..231af33fd48 100644
--- a/dlls/winex11.drv/keyboard.c
+++ b/dlls/winex11.drv/keyboard.c
@@ -1123,6 +1123,7 @@ static WORD EVENT_event_to_vkey( XIC xic, XKeyEvent *e)
@@ -1121,6 +1121,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 )
{
@@ -166,9 +166,9 @@ index 83169a9bb4d..ecd513ee2a4 100644
INPUT input;
TRACE_(key)( "hwnd %p vkey=%04x scan=%04x flags=%04x\n", hwnd, vkey, scan, flags );
@@ -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;
@@ -1132,7 +1133,7 @@ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, UINT fl
input.ki.time = time;
input.ki.dwExtraInfo = 0;
- __wine_send_input( hwnd, &input, NULL );
+ __wine_send_input( hwnd, &input, &rawinput );
@@ -176,10 +176,10 @@ index 83169a9bb4d..ecd513ee2a4 100644
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 20d57aa76f3..7925a2f4070 100644
index d8e9b8155fb..61b1870ba5a 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -626,6 +626,7 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
@@ -625,6 +625,7 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
{
struct x11drv_win_data *data;
@@ -187,7 +187,7 @@ index 20d57aa76f3..7925a2f4070 100644
input->type = INPUT_MOUSE;
@@ -633,7 +634,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -632,7 +633,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
{
struct x11drv_thread_data *thread_data = x11drv_thread_data();
if (!thread_data->clipping_cursor || thread_data->clip_window != window) return;
@@ -196,7 +196,7 @@ index 20d57aa76f3..7925a2f4070 100644
return;
}
@@ -660,7 +661,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -659,7 +660,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
SERVER_END_REQ;
}
@@ -205,7 +205,7 @@ index 20d57aa76f3..7925a2f4070 100644
}
#ifdef SONAME_LIBXCURSOR
@@ -1588,6 +1589,7 @@ void move_resize_window( HWND hwnd, int dir )
@@ -1587,6 +1588,7 @@ void move_resize_window( HWND hwnd, int dir )
{
MSG msg;
INPUT input;
@@ -213,16 +213,16 @@ index 20d57aa76f3..7925a2f4070 100644
int x, y, rootX, rootY;
if (!XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &x, &y, &xstate )) break;
@@ -1603,7 +1605,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;
@@ -1602,7 +1604,7 @@ void move_resize_window( HWND hwnd, int dir )
input.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.mi.time = NtGetTickCount();
input.mi.dwExtraInfo = 0;
- __wine_send_input( hwnd, &input, NULL );
+ __wine_send_input( hwnd, &input, &rawinput );
}
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
@@ -1816,6 +1818,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -1815,6 +1817,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
{
XIRawEvent *event = xev->data;
@@ -230,8 +230,8 @@ index 20d57aa76f3..7925a2f4070 100644
INPUT input;
if (broken_rawevents && is_old_motion_event( xev->serial ))
@@ -1833,7 +1836,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.u.mi.dy = 0;
@@ -1832,7 +1835,7 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.mi.dy = 0;
if (!map_raw_event_coords( event, &input )) return FALSE;
- __wine_send_input( 0, &input, NULL );

View File

@@ -1,4 +1,4 @@
From 8cfe8a261f9138c6227610fd0c9bc222bc0b1871 Mon Sep 17 00:00:00 2001
From cf4f812de02820e94c30758a9267872bd5429ac0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
Date: Mon, 25 Oct 2021 11:45:47 +0200
Subject: [PATCH] winex11.drv: Listen to RawMotion and RawButton* events in the
@@ -54,10 +54,10 @@ index e5021eb38ff..9cf7969dce2 100644
#endif
}
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 7925a2f4070..fce58d2b48a 100644
index 61b1870ba5a..27916622ed8 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -389,7 +389,18 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
@@ -388,7 +388,18 @@ void x11drv_xinput_enable( Display *display, Window window, long event_mask )
memset( mask_bits, 0, sizeof(mask_bits) );
XISetMask( mask_bits, XI_DeviceChanged );
XISetMask( mask_bits, XI_RawMotion );
@@ -77,7 +77,7 @@ index 7925a2f4070..fce58d2b48a 100644
pXISelectEvents( display, DefaultRootWindow( display ), &mask, 1 );
@@ -626,7 +637,6 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
@@ -625,7 +636,6 @@ static void map_event_coords( HWND hwnd, Window window, Window event_root, int x
static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPUT *input )
{
struct x11drv_win_data *data;
@@ -85,7 +85,7 @@ index 7925a2f4070..fce58d2b48a 100644
input->type = INPUT_MOUSE;
@@ -634,7 +644,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -633,7 +643,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
{
struct x11drv_thread_data *thread_data = x11drv_thread_data();
if (!thread_data->clipping_cursor || thread_data->clip_window != window) return;
@@ -94,7 +94,7 @@ index 7925a2f4070..fce58d2b48a 100644
return;
}
@@ -661,7 +671,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
@@ -660,7 +670,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
SERVER_END_REQ;
}
@@ -103,7 +103,7 @@ index 7925a2f4070..fce58d2b48a 100644
}
#ifdef SONAME_LIBXCURSOR
@@ -1589,7 +1599,6 @@ void move_resize_window( HWND hwnd, int dir )
@@ -1588,7 +1598,6 @@ void move_resize_window( HWND hwnd, int dir )
{
MSG msg;
INPUT input;
@@ -111,16 +111,16 @@ index 7925a2f4070..fce58d2b48a 100644
int x, y, rootX, rootY;
if (!XQueryPointer( display, root_window, &root, &child, &rootX, &rootY, &x, &y, &xstate )) break;
@@ -1605,7 +1614,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;
@@ -1604,7 +1613,7 @@ void move_resize_window( HWND hwnd, int dir )
input.mi.dwFlags = button_up_flags[button - 1] | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE;
input.mi.time = NtGetTickCount();
input.mi.dwExtraInfo = 0;
- __wine_send_input( hwnd, &input, &rawinput );
+ __wine_send_input( hwnd, &input, NULL );
}
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE ))
@@ -1817,6 +1826,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
@@ -1816,6 +1825,7 @@ static BOOL map_raw_event_coords( XIRawEvent *event, INPUT *input )
*/
static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
{
@@ -128,8 +128,8 @@ index 7925a2f4070..fce58d2b48a 100644
XIRawEvent *event = xev->data;
RAWINPUT rawinput;
INPUT input;
@@ -1836,7 +1846,85 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.u.mi.dy = 0;
@@ -1835,7 +1845,85 @@ static BOOL X11DRV_RawMotion( XGenericEventCookie *xev )
input.mi.dy = 0;
if (!map_raw_event_coords( event, &input )) return FALSE;
- __wine_send_input( 0, &input, &rawinput );
@@ -141,18 +141,18 @@ index 7925a2f4070..fce58d2b48a 100644
+ rawinput.header.dwSize = offsetof(RAWINPUT, data) + sizeof(RAWMOUSE);
+ rawinput.header.hDevice = ULongToHandle(1); /* WINE_MOUSE_HANDLE */
+ rawinput.header.wParam = RIM_INPUT;
+ rawinput.data.mouse.usFlags = input.u.mi.dwFlags;
+ rawinput.data.mouse.usFlags = input.mi.dwFlags;
+ rawinput.data.mouse.ulRawButtons = 0;
+ rawinput.data.mouse.u.usButtonData = 0;
+ rawinput.data.mouse.u.usButtonFlags = 0;
+ rawinput.data.mouse.lLastX = input.u.mi.dx;
+ rawinput.data.mouse.lLastY = input.u.mi.dy;
+ rawinput.data.mouse.usButtonData = 0;
+ rawinput.data.mouse.usButtonFlags = 0;
+ rawinput.data.mouse.lLastX = input.mi.dx;
+ rawinput.data.mouse.lLastY = input.mi.dy;
+ rawinput.data.mouse.ulExtraInformation = 0;
+
+ input.type = INPUT_HARDWARE;
+ input.u.hi.uMsg = WM_INPUT;
+ input.u.hi.wParamH = 0;
+ input.u.hi.wParamL = 0;
+ input.hi.uMsg = WM_INPUT;
+ input.hi.wParamH = 0;
+ input.hi.wParamL = 0;
+ if (rawinput.data.mouse.lLastX || rawinput.data.mouse.lLastY)
+ __wine_send_input( 0, &input, &rawinput );
+ }
@@ -200,22 +200,22 @@ index 7925a2f4070..fce58d2b48a 100644
+ rawinput.data.mouse.usFlags = button_down_flags[button];
+ rawinput.data.mouse.ulRawButtons = button_down_data[button];
+ }
+ rawinput.data.mouse.u.usButtonData = 0;
+ rawinput.data.mouse.u.usButtonFlags = 0;
+ rawinput.data.mouse.usButtonData = 0;
+ rawinput.data.mouse.usButtonFlags = 0;
+ rawinput.data.mouse.lLastX = 0;
+ rawinput.data.mouse.lLastY = 0;
+ rawinput.data.mouse.ulExtraInformation = 0;
+
+ input.type = INPUT_HARDWARE;
+ input.u.hi.uMsg = WM_INPUT;
+ input.u.hi.wParamH = 0;
+ input.u.hi.wParamL = 0;
+ input.hi.uMsg = WM_INPUT;
+ input.hi.wParamH = 0;
+ input.hi.wParamL = 0;
+ if (rawinput.data.mouse.usFlags || rawinput.data.mouse.ulRawButtons)
+ __wine_send_input( 0, &input, &rawinput );
return TRUE;
}
@@ -1912,6 +2000,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
@@ -1911,6 +1999,10 @@ BOOL X11DRV_GenericEvent( HWND hwnd, XEvent *xev )
case XI_RawMotion:
ret = X11DRV_RawMotion( event );
break;
@@ -227,7 +227,7 @@ index 7925a2f4070..fce58d2b48a 100644
default:
TRACE( "Unhandled event %#x\n", event->evtype );
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index d147add9d68..30486210df5 100644
index 5778a7eceb4..36ed7810700 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -408,6 +408,7 @@ struct x11drv_thread_data