[PATCH 3/3] winex11.drv: Don't trigger a MotionNotify event right after a RawMotion event and make only absolute movements change the cursor's last change time

Max Qian public at maxqia.com
Thu Sep 8 03:15:57 CDT 2016


Signed-off-by: Max Qian <public at maxqia.com>
---
 dlls/winex11.drv/event.c | 12 +++++-------
 server/queue.c           |  4 ++--
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index a0bfe05..a3dd386 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -345,14 +345,9 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
                 return MERGE_DISCARD;
             }
             break;
-#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
-        case GenericEvent:
-            if (next->xcookie.extension != xinput2_opcode) break;
-            if (next->xcookie.evtype != XI_RawMotion) break;
-            if (x11drv_thread_data()->warp_serial) break;
-            return MERGE_KEEP;
         }
         break;
+#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
     case GenericEvent:
         if (prev->xcookie.extension != xinput2_opcode) break;
         if (prev->xcookie.evtype != XI_RawMotion) break;
@@ -363,9 +358,12 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
             if (next->xcookie.evtype != XI_RawMotion) break;
             if (x11drv_thread_data()->warp_serial) break;
             return merge_raw_motion_events( prev->xcookie.data, next->xcookie.data );
-#endif
+        case MotionNotify:
+            TRACE("discarding MotionNotify in favor of RawMotion\n");
+            return MERGE_IGNORE;
         }
         break;
+#endif
     }
     return MERGE_HANDLE;
 }
diff --git a/server/queue.c b/server/queue.c
index 9ccdda3..73c216a 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -1610,10 +1610,9 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
         WM_MOUSEHWHEEL   /* 0x1000 = MOUSEEVENTF_HWHEEL */
     };
 
-    desktop->cursor.last_change = get_tick_count();
     flags = input->mouse.flags;
     time  = input->mouse.time;
-    if (!time) time = desktop->cursor.last_change;
+    if (!time) time = get_tick_count();
 
     if (flags & MOUSEEVENTF_MOVE)
     {
@@ -1621,6 +1620,7 @@ static int queue_mouse_message( struct desktop *desktop, user_handle_t win, cons
         {
             x = input->mouse.x;
             y = input->mouse.y;
+            desktop->cursor.last_change = get_tick_count();
             if (flags & ~(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE) &&
                 x == desktop->cursor.x && y == desktop->cursor.y)
                 flags &= ~MOUSEEVENTF_MOVE;
-- 
2.9.3




More information about the wine-patches mailing list