[PATCH 5/9] server: Don't emulate rawinput mouse events if native exist.

Derek Lesho dereklesho52 at gmail.com
Mon Aug 5 00:40:07 CDT 2019


Signed-off-by: Derek Lesho <dereklesho52 at Gmail.com>
---
v11:
  - Make emulate_raw_mouse static
  - Stop emulating raw mouse input even when there isn't a present device
  - Cleanup convoluted code
---
 server/queue.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/server/queue.c b/server/queue.c
index f2e9c4fab1..70b4f88302 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;
@@ -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;
+
     for (i = 0; i < ARRAY_SIZE( messages ); i++)
     {
         if (!messages[i]) continue;
@@ -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.22.0




More information about the wine-devel mailing list