From: EBADBEEF errno@ebadf.com
This is plumbing for a graphics driver to be responsible for rawinput events (instead of letting the server generate them). --- dlls/hidclass.sys/device.c | 2 +- dlls/hidclass.sys/pnp.c | 2 +- dlls/win32u/input.c | 7 ++++--- dlls/win32u/message.c | 4 +++- dlls/win32u/win32u.spec | 2 +- dlls/win32u/win32u_private.h | 2 +- dlls/wineandroid.drv/keyboard.c | 2 +- dlls/wineandroid.drv/window.c | 2 +- dlls/winemac.drv/keyboard.c | 2 +- dlls/winemac.drv/mouse.c | 2 +- dlls/winewayland.drv/wayland_pointer.c | 2 +- dlls/winex11.drv/keyboard.c | 2 +- dlls/winex11.drv/mouse.c | 8 ++++---- include/ntuser.h | 2 +- 14 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/dlls/hidclass.sys/device.c b/dlls/hidclass.sys/device.c index d673a8c2e88..512e533c796 100644 --- a/dlls/hidclass.sys/device.c +++ b/dlls/hidclass.sys/device.c @@ -252,7 +252,7 @@ static void hid_device_queue_input( DEVICE_OBJECT *device, HID_XFER_PACKET *pack input.hi.uMsg = WM_INPUT; input.hi.wParamH = 0; input.hi.wParamL = 0; - __wine_send_input( 0, &input, rawinput ); + __wine_send_input( 0, &input, rawinput, 0 );
free( rawinput ); } diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c index ab3cd5b2cb5..c47962f676f 100644 --- a/dlls/hidclass.sys/pnp.c +++ b/dlls/hidclass.sys/pnp.c @@ -134,7 +134,7 @@ static void send_wm_input_device_change(BASE_DEVICE_EXTENSION *ext, LPARAM param input.hi.uMsg = WM_INPUT_DEVICE_CHANGE; input.hi.wParamH = 0; input.hi.wParamL = 0; - __wine_send_input(0, &input, &rawinput); + __wine_send_input(0, &input, &rawinput, 0); }
static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_pdo) diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c index 3e6e440de93..a3fd0df0c5a 100644 --- a/dlls/win32u/input.c +++ b/dlls/win32u/input.c @@ -599,10 +599,11 @@ BOOL WINAPI NtUserAttachThreadInput( DWORD from, DWORD to, BOOL attach ) * __wine_send_input (win32u.@) * * Internal SendInput function to allow the graphics driver to inject real events. + * */ -BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ) +BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT noraw_flags ) { - return set_ntstatus( send_hardware_message( hwnd, input, rawinput, 0 )); + return set_ntstatus( send_hardware_message( hwnd, input, rawinput, 0, noraw_flags )); }
/*********************************************************************** @@ -684,7 +685,7 @@ UINT WINAPI NtUserSendInput( UINT count, INPUT *inputs, int size ) update_mouse_coords( &input ); /* fallthrough */ case INPUT_KEYBOARD: - status = send_hardware_message( 0, &input, NULL, SEND_HWMSG_INJECTED ); + status = send_hardware_message( 0, &input, NULL, SEND_HWMSG_INJECTED, 0 ); break; case INPUT_HARDWARE: RtlSetLastWin32Error( ERROR_CALL_NOT_IMPLEMENTED ); diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c index 961d2c0dc09..e9a60b1c605 100644 --- a/dlls/win32u/message.c +++ b/dlls/win32u/message.c @@ -3416,7 +3416,7 @@ LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, /*********************************************************************** * send_hardware_message */ -NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags ) +NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT flags, UINT noraw_flags ) { struct send_message_info info; int prev_x, prev_y, new_x, new_y; @@ -3461,6 +3461,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r req->input.mouse.y = input->mi.dy; req->input.mouse.data = input->mi.mouseData; req->input.mouse.flags = input->mi.dwFlags; + req->input.mouse.noraw = noraw_flags; req->input.mouse.time = input->mi.time; req->input.mouse.info = input->mi.dwExtraInfo; affects_key_state = !!(input->mi.dwFlags & (MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP | @@ -3472,6 +3473,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r req->input.kbd.vkey = input->ki.wVk; req->input.kbd.scan = input->ki.wScan; req->input.kbd.flags = input->ki.dwFlags; + req->input.kbd.noraw = noraw_flags; req->input.kbd.time = input->ki.time; req->input.kbd.info = input->ki.dwExtraInfo; affects_key_state = TRUE; diff --git a/dlls/win32u/win32u.spec b/dlls/win32u/win32u.spec index 24dccb6ec1d..e14f9bf4d8c 100644 --- a/dlls/win32u/win32u.spec +++ b/dlls/win32u/win32u.spec @@ -1322,4 +1322,4 @@
@ stdcall -syscall __wine_get_icm_profile(long long ptr ptr) @ stdcall -syscall __wine_get_file_outline_text_metric(wstr ptr ptr ptr) -@ stdcall -syscall __wine_send_input(long ptr ptr) +@ stdcall -syscall __wine_send_input(long ptr ptr long) diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 6380a0808c8..1cb5a1be72b 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -132,7 +132,7 @@ extern void track_mouse_menu_bar( HWND hwnd, INT ht, int x, int y ) DECLSPEC_HID extern BOOL kill_system_timer( HWND hwnd, UINT_PTR id ) DECLSPEC_HIDDEN; extern BOOL reply_message_result( LRESULT result ) DECLSPEC_HIDDEN; extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, - UINT flags ) DECLSPEC_HIDDEN; + UINT flags, UINT noraw_flags ) DECLSPEC_HIDDEN; extern LRESULT send_internal_message_timeout( DWORD dest_pid, DWORD dest_tid, UINT msg, WPARAM wparam, LPARAM lparam, UINT flags, UINT timeout, PDWORD_PTR res_ptr ) DECLSPEC_HIDDEN; diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c index 9f369094949..c430d7929e1 100644 --- a/dlls/wineandroid.drv/keyboard.c +++ b/dlls/wineandroid.drv/keyboard.c @@ -680,7 +680,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, NULL, 0 ); }
/*********************************************************************** diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index d62a2c53909..e678097a70c 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -514,7 +514,7 @@ static int process_events( DWORD mask ) } SERVER_END_REQ; } - __wine_send_input( capture ? capture : event->data.motion.hwnd, &event->data.motion.input, NULL ); + __wine_send_input( capture ? capture : event->data.motion.hwnd, &event->data.motion.input, NULL, 0 ); } break;
diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index bf1daa7a5df..902c1280337 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -1001,7 +1001,7 @@ static void macdrv_send_keyboard_input(HWND hwnd, WORD vkey, WORD scan, unsigned input.ki.time = time; input.ki.dwExtraInfo = 0;
- __wine_send_input(hwnd, &input, NULL); + __wine_send_input(hwnd, &input, NULL, 0); }
diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index 2f05a33a8b5..4e3b5653425 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -158,7 +158,7 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags, input.mi.time = time; input.mi.dwExtraInfo = 0;
- __wine_send_input(top_level_hwnd, &input, NULL); + __wine_send_input(top_level_hwnd, &input, NULL, 0); }
diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c index ff376882d73..9e7fcf2ff5f 100644 --- a/dlls/winewayland.drv/wayland_pointer.c +++ b/dlls/winewayland.drv/wayland_pointer.c @@ -154,7 +154,7 @@ static void pointer_handle_button(void *data, struct wl_pointer *wl_pointer,
TRACE("hwnd=%p button=%#x state=%u\n", hwnd, button, state);
- __wine_send_input(hwnd, &input, NULL); + __wine_send_input(hwnd, &input, NULL, 0); }
static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 5c7f6c37276..895b106297d 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1132,7 +1132,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, NULL, 0 ); }
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 612fff9995c..2ea007ab588 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -528,7 +528,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; - __wine_send_input( hwnd, input, NULL ); + __wine_send_input( hwnd, input, NULL, 0 ); return; }
@@ -555,7 +555,7 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU SERVER_END_REQ; }
- __wine_send_input( hwnd, input, NULL ); + __wine_send_input( hwnd, input, NULL, 0 ); }
#ifdef SONAME_LIBXCURSOR @@ -1498,7 +1498,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, NULL, 0 ); }
while (NtUserPeekMessage( &msg, 0, 0, 0, PM_REMOVE )) @@ -1747,7 +1747,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 ); + __wine_send_input( 0, &input, NULL, 0 ); return TRUE; }
diff --git a/include/ntuser.h b/include/ntuser.h index def89a82aff..05859762036 100644 --- a/include/ntuser.h +++ b/include/ntuser.h @@ -1387,6 +1387,6 @@ static inline BOOL NtUserShowOwnedPopups( HWND hwnd, BOOL show ) }
/* Wine extensions */ -W32KAPI BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput ); +W32KAPI BOOL WINAPI __wine_send_input( HWND hwnd, const INPUT *input, const RAWINPUT *rawinput, UINT noraw_flags );
#endif /* _NTUSER_ */