The same "struct message" cannot be reused easily, revert to old behavior and allocate a new one. This fixes keyboard input on e.g. Witcher 3, which would just hang upon pressing the first key.
Fixes: 383cf211 ("server: Add a helper function to allocate a hardware message.") Signed-off-by: Andre Heider a.heider@gmail.com --- server/queue.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 9dfbd1e294..545991b99c 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1775,11 +1775,11 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c break; }
- if (!(msg = alloc_hardware_message( input->kbd.info, source, time ))) return 0; - msg_data = msg->data; - if ((device = current->process->rawinput_kbd)) { + if (!(msg = alloc_hardware_message( input->kbd.info, source, time ))) return 0; + msg_data = msg->data; + msg->win = device->target; msg->msg = WM_INPUT; msg->wparam = RIM_INPUT; @@ -1793,6 +1793,9 @@ static int queue_keyboard_message( struct desktop *desktop, user_handle_t win, c queue_hardware_message( desktop, msg, 0 ); }
+ if (!(msg = alloc_hardware_message( input->kbd.info, source, time ))) return 0; + msg_data = msg->data; + msg->win = get_user_full_handle( win ); msg->msg = message_code; msg->lparam = (input->kbd.scan << 16) | 1u; /* repeat count */