From ac1dd32eca67140548a27b40904cccd56c785d7d Mon Sep 17 00:00:00 2001 From: Derek Lesho Date: Tue, 25 Jun 2019 21:58:34 -0400 Subject: [PATCH 05/10] server: Don't emulate rawinput mouse events if native exist. Signed-off-by: Derek Lesho --- server/queue.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/queue.c b/server/queue.c index c61fd28a24..e540fd0a64 100644 --- a/server/queue.c +++ b/server/queue.c @@ -1599,6 +1599,8 @@ static int send_hook_ll_message( struct desktop *desktop, struct message *hardwa return 1; } +static int emulate_raw_mouse = 1; + /* 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 ) @@ -1664,7 +1666,8 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons y = desktop->cursor.y; } - if ((device = current->process->rawinput_mouse)) + device = current->process->rawinput_mouse; + if (device && emulate_raw_mouse) { if (!(msg = alloc_hardware_message( input->mouse.info, source, time ))) return 0; msg_data = msg->data; @@ -2435,6 +2438,7 @@ DECL_HANDLER(send_rawinput_message) switch (req->input.type) { case RIM_TYPEMOUSE: + emulate_raw_mouse = 0; if ((device = current->process->rawinput_mouse)) { struct thread *thread = device->target ? get_window_thread( device->target ) : NULL; -- 2.23.0