This is an alternative approach, to illustrate what I described here:
https://www.winehq.org/pipermail/wine-devel/2019-November/154283.html
This is more change that the two request flags in the previous implementation, but it may be righter. In particular, I'm thinking that it's good to reduce the native driver dependency on user32, for instance for the PE conversion, but that may not be the target.
I skipped the wait for message reply, I'm assuming here a bit blindly that it's alright: the events come from external source anyway so there should not be any synchronization requirement.
I also skipped the thread local key_state update on keyboard events, It can still be done in the drivers if it's an important optimization.
Rémi Bernon (6): wineandroid.drv: Replace __wine_send_input with direct send_hardware_message request. winemac.drv: Replace __wine_send_input with direct send_hardware_message request. winex11.drv: Replace __wine_send_input with direct send_hardware_message request. user32: Remove __wine_send_input function. server: Add src field to hw_input_t, replace SEND_HWMSG_INJECTED. server: Replace send_hardware_message SEND_HWMSG_INJECTED flag.
dlls/user32/input.c | 17 +--- dlls/user32/message.c | 10 ++- dlls/user32/user32.spec | 1 - dlls/user32/user_private.h | 2 +- dlls/wineandroid.drv/keyboard.c | 23 ++--- dlls/wineandroid.drv/window.c | 31 ++++++- dlls/winemac.drv/ime.c | 32 ++++--- dlls/winemac.drv/keyboard.c | 23 ++--- dlls/winemac.drv/mouse.c | 23 +++-- dlls/winex11.drv/keyboard.c | 23 ++--- dlls/winex11.drv/mouse.c | 145 ++++++++++++++------------------ include/winuser.h | 4 - server/protocol.def | 16 ++-- server/queue.c | 28 ++++-- server/trace.c | 20 +++-- 15 files changed, 216 insertions(+), 182 deletions(-)