On 8/2/19 8:24 AM, Derek Lesho wrote:
Signed-off-by: Derek Lesho <dereklesho52(a)Gmail.com> --- v10: Instead of relying on custom flags, stop emulating raw mouse input when we receive a native msg. --- server/queue.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/server/queue.c b/server/queue.c index f2e9c4fab1..c4042994e8 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; }
+int emulate_raw_mouse = 1; +
static wouldn't hurt.
/* 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; @@ -1713,11 +1716,11 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons }
queue_hardware_message( desktop, msg, 0 ); - - if (device->flags & RIDEV_NOLEGACY) - return FALSE; }
+ if (device && device->flags & RIDEV_NOLEGACY) + return FALSE; +
See PATCH 1/9 comment.
for (i = 0; i < ARRAY_SIZE( messages ); i++) { if (!messages[i]) continue; @@ -2437,7 +2440,11 @@ DECL_HANDLER(send_rawinput_message) case RIM_TYPEMOUSE: if ((device = current->process->rawinput_mouse)) { - struct thread *thread = device->target ? get_window_thread( device->target ) : NULL; + struct thread *thread; + + emulate_raw_mouse = 0; + + thread = device->target ? get_window_thread( device->target ) : NULL; if ((current->queue->input != desktop->foreground_input) || (thread && thread != current)) goto done;
Not sure why you need to change the thread variable assignment here. And I think you can set emulate_raw_mouse to 0 regardless of the device status (so before the if, right after "case RIM_TYPEMOUSE:"). -- Rémi Bernon <rbernon(a)codeweavers.com>