Replace it with hw_input_t HW_INPUT_SRC_INJECTED src bit to indicate the injected nature of an input message.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/user32/message.c | 1 - dlls/wineandroid.drv/keyboard.c | 1 - dlls/wineandroid.drv/window.c | 2 -- dlls/winemac.drv/ime.c | 1 - dlls/winemac.drv/keyboard.c | 1 - dlls/winemac.drv/mouse.c | 1 - dlls/winex11.drv/keyboard.c | 1 - dlls/winex11.drv/mouse.c | 1 - server/protocol.def | 3 +-- server/queue.c | 16 +++++++++------- server/trace.c | 5 ++++- 11 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/dlls/user32/message.c b/dlls/user32/message.c index 8613fa5f971..eaca6808597 100644 --- a/dlls/user32/message.c +++ b/dlls/user32/message.c @@ -3339,7 +3339,6 @@ NTSTATUS inject_hardware_message( HWND hwnd, const INPUT *input ) SERVER_START_REQ( send_hardware_message ) { req->win = wine_server_user_handle( hwnd ); - req->flags = SEND_HWMSG_INJECTED; req->input.type = input->type; switch (input->type) { diff --git a/dlls/wineandroid.drv/keyboard.c b/dlls/wineandroid.drv/keyboard.c index a714b38f5e4..c96c3db4bda 100644 --- a/dlls/wineandroid.drv/keyboard.c +++ b/dlls/wineandroid.drv/keyboard.c @@ -674,7 +674,6 @@ static void send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD flags ) SERVER_START_REQ( send_hardware_message ) { req->win = wine_server_user_handle( hwnd ); - req->flags = 0; req->input.type = INPUT_KEYBOARD; req->input.kbd.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.kbd.vkey = vkey; diff --git a/dlls/wineandroid.drv/window.c b/dlls/wineandroid.drv/window.c index 2d88c1f9816..cebfd62719c 100644 --- a/dlls/wineandroid.drv/window.c +++ b/dlls/wineandroid.drv/window.c @@ -525,7 +525,6 @@ static int process_events( DWORD mask ) SERVER_START_REQ( send_hardware_message ) { req->win = wine_server_user_handle( capture ? capture : event->data.motion.hwnd ); - req->flags = 0; req->input.type = INPUT_MOUSE; req->input.mouse.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.mouse.x = event->data.motion.input.u.mi.dx; @@ -554,7 +553,6 @@ static int process_events( DWORD mask ) SERVER_START_REQ( send_hardware_message ) { req->win = wine_server_user_handle( 0 ); - req->flags = 0; req->input.type = INPUT_KEYBOARD; req->input.kbd.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.kbd.vkey = event->data.kbd.input.u.ki.wVk; diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index ebbb1e8ccb4..00dcb192804 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -1389,7 +1389,6 @@ static void send_keyboard_char(HWND hwnd, int scan, int flags) SERVER_START_REQ(send_hardware_message) { req->win = wine_server_user_handle(hwnd); - req->flags = 0; req->input.type = INPUT_KEYBOARD; req->input.kbd.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.kbd.vkey = 0; diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index bb09d1de1e0..4fd7bf71aca 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -923,7 +923,6 @@ static void macdrv_send_keyboard_input(HWND hwnd, WORD vkey, WORD scan, DWORD fl SERVER_START_REQ(send_hardware_message) { req->win = wine_server_user_handle(hwnd); - req->flags = 0; req->input.type = INPUT_KEYBOARD; req->input.kbd.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.kbd.vkey = vkey; diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index 388b5d8e460..57950217902 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -160,7 +160,6 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags, SERVER_START_REQ(send_hardware_message) { req->win = wine_server_user_handle(top_level_hwnd); - req->flags = 0; req->input.type = INPUT_MOUSE; req->input.mouse.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.mouse.x = x; diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 2725266f4b3..1663b3d99ad 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1142,7 +1142,6 @@ static void X11DRV_send_keyboard_input( HWND hwnd, WORD vkey, WORD scan, DWORD f SERVER_START_REQ( send_hardware_message ) { req->win = wine_server_user_handle( hwnd ); - req->flags = 0; req->input.type = INPUT_KEYBOARD; req->input.kbd.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.kbd.vkey = vkey; diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index f98e6804dea..346ae93b7b7 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -598,7 +598,6 @@ static void send_mouse_input( HWND hwnd, LONG dx, LONG dy, DWORD data, DWORD fla SERVER_START_REQ( send_hardware_message ) { req->win = wine_server_user_handle( hwnd ); - req->flags = 0; req->input.type = INPUT_MOUSE; req->input.mouse.src = HW_INPUT_SRC_WINDOW|HW_INPUT_SRC_RAWINPUT; req->input.mouse.x = dx; diff --git a/server/protocol.def b/server/protocol.def index 0e302235ca1..cbc0e9ceaad 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -361,6 +361,7 @@ typedef union } hw_input_t; #define HW_INPUT_SRC_WINDOW 1 #define HW_INPUT_SRC_RAWINPUT 2 +#define HW_INPUT_SRC_INJECTED 4
typedef union { @@ -2310,7 +2311,6 @@ enum message_type @REQ(send_hardware_message) user_handle_t win; /* window handle */ hw_input_t input; /* input data */ - unsigned int flags; /* flags (see below) */ @REPLY int wait; /* do we need to wait for a reply? */ int prev_x; /* previous cursor position */ @@ -2319,7 +2319,6 @@ enum message_type int new_y; VARARG(keystate,bytes); /* global state array for all the keys */ @END -#define SEND_HWMSG_INJECTED 0x01
/* Get a message from the current queue */ diff --git a/server/queue.c b/server/queue.c index 19da1f34c74..95ffc8db7c3 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1598,8 +1598,9 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa
/* 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 ) + struct msg_queue *sender ) { + unsigned int origin = (input->mouse.src & HW_INPUT_SRC_INJECTED ? IMO_INJECTED : IMO_HARDWARE); const struct rawinput_device *device; struct hardware_msg_data *msg_data; struct message *msg; @@ -1705,8 +1706,9 @@ 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, - unsigned int origin, struct msg_queue *sender ) + struct msg_queue *sender ) { + unsigned int origin = (input->kbd.src & HW_INPUT_SRC_INJECTED ? IMO_INJECTED : IMO_HARDWARE); struct hw_msg_source source = { IMDT_KEYBOARD, origin }; const struct rawinput_device *device; struct hardware_msg_data *msg_data; @@ -1836,8 +1838,9 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c
/* queue a hardware message for a custom type of event */ static void queue_custom_hardware_message( struct desktop *desktop, user_handle_t win, - unsigned int origin, const hw_input_t *input ) + const hw_input_t *input ) { + unsigned int origin = (input->hw.src & HW_INPUT_SRC_INJECTED ? IMO_INJECTED : IMO_HARDWARE); struct hw_msg_source source = { IMDT_UNAVAILABLE, origin }; struct message *msg;
@@ -2336,7 +2339,6 @@ DECL_HANDLER(send_hardware_message) { struct thread *thread = NULL; struct desktop *desktop; - unsigned int origin = (req->flags & SEND_HWMSG_INJECTED ? IMO_INJECTED : IMO_HARDWARE); struct msg_queue *sender = get_current_queue(); data_size_t size = min( 256, get_reply_max_size() );
@@ -2359,13 +2361,13 @@ DECL_HANDLER(send_hardware_message) switch (req->input.type) { case INPUT_MOUSE: - reply->wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender ); + reply->wait = queue_mouse_message( desktop, req->win, &req->input, sender ); break; case INPUT_KEYBOARD: - reply->wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender ); + reply->wait = queue_keyboard_message( desktop, req->win, &req->input, sender ); break; case INPUT_HARDWARE: - queue_custom_hardware_message( desktop, req->win, origin, &req->input ); + queue_custom_hardware_message( desktop, req->win, &req->input ); break; default: set_error( STATUS_INVALID_PARAMETER ); diff --git a/server/trace.c b/server/trace.c index 6674505bc1c..61894e8af19 100644 --- a/server/trace.c +++ b/server/trace.c @@ -379,12 +379,13 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data )
static void dump_hw_input( const char *prefix, const hw_input_t *input ) { - char src[] = "--"; + char src[] = "---"; switch (input->type) { case INPUT_MOUSE: if (input->mouse.src & HW_INPUT_SRC_WINDOW) src[0] = 'w'; if (input->mouse.src & HW_INPUT_SRC_RAWINPUT) src[1] = 'r'; + if (input->mouse.src & HW_INPUT_SRC_INJECTED) src[2] = 'i'; fprintf( stderr, "%s{type=MOUSE,src=%s,x=%d,y=%d,data=%08x,flags=%08x,time=%u", prefix, src, input->mouse.x, input->mouse.y, input->mouse.data, input->mouse.flags, input->mouse.time ); @@ -394,6 +395,7 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input ) case INPUT_KEYBOARD: if (input->kbd.src & HW_INPUT_SRC_WINDOW) src[0] = 'w'; if (input->kbd.src & HW_INPUT_SRC_RAWINPUT) src[1] = 'r'; + if (input->kbd.src & HW_INPUT_SRC_INJECTED) src[2] = 'i'; fprintf( stderr, "%s{type=KEYBOARD,src=%s,vkey=%04hx,scan=%04hx,flags=%08x,time=%u", prefix, src, input->kbd.vkey, input->kbd.scan, input->kbd.flags, input->kbd.time ); dump_uint64( ",info=", &input->kbd.info ); @@ -402,6 +404,7 @@ static void dump_hw_input( const char *prefix, const hw_input_t *input ) case INPUT_HARDWARE: if (input->hw.src & HW_INPUT_SRC_WINDOW) src[0] = 'w'; if (input->hw.src & HW_INPUT_SRC_RAWINPUT) src[1] = 'r'; + if (input->hw.src & HW_INPUT_SRC_INJECTED) src[2] = 'i'; fprintf( stderr, "%s{type=HARDWARE,src=%s,msg=%04x", prefix, src, input->hw.msg ); dump_uint64( ",lparam=", &input->hw.lparam ); fputc( '}', stderr );