Tests show that injected input indeed wait on LL-hooks to be processed. However real hardware input isn't normally sent by the processes themselves like Wine does, and it is unnecessary to wait for the LL-hooks to be processed. The applications threads should instead return from the ProcessEvent call when input is received, and process their hooks later as needed, or do some other tasks application might expect them to.
From: Rémi Bernon rbernon@codeweavers.com
--- server/queue.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 0b9430c5f4d..91284f1da17 100644 --- a/server/queue.c +++ b/server/queue.c @@ -2871,7 +2871,8 @@ DECL_HANDLER(send_hardware_message) { struct desktop *desktop; unsigned int origin = (req->flags & SEND_HWMSG_INJECTED ? IMO_INJECTED : IMO_HARDWARE); - struct msg_queue *sender = get_current_queue(); + struct msg_queue *sender = req->flags & SEND_HWMSG_INJECTED ? get_current_queue() : NULL; + int wait = 0;
if (!(desktop = get_hardware_input_desktop( req->win ))) return; if ((origin == IMO_INJECTED && desktop != current->queue->input->desktop) || @@ -2888,10 +2889,10 @@ DECL_HANDLER(send_hardware_message) switch (req->input.type) { case INPUT_MOUSE: - reply->wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender ); + wait = queue_mouse_message( desktop, req->win, &req->input, origin, sender ); break; case INPUT_KEYBOARD: - reply->wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender ); + wait = queue_keyboard_message( desktop, req->win, &req->input, origin, sender ); break; case INPUT_HARDWARE: queue_custom_hardware_message( desktop, req->win, origin, &req->input ); @@ -2900,6 +2901,7 @@ DECL_HANDLER(send_hardware_message) set_error( STATUS_INVALID_PARAMETER ); }
+ reply->wait = sender ? wait : 0; reply->new_x = desktop->cursor.x; reply->new_y = desktop->cursor.y; release_object( desktop );