Alexandre Julliard : winex11: Allow MotionNotify events through occasionally while XInput is active.

Alexandre Julliard julliard at winehq.org
Fri May 13 11:17:50 CDT 2011


Module: wine
Branch: master
Commit: 8e9b4e0a5c6bee5f72ca2314db26233638f0e1d2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8e9b4e0a5c6bee5f72ca2314db26233638f0e1d2

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri May 13 16:19:45 2011 +0200

winex11: Allow MotionNotify events through occasionally while XInput is active.

---

 dlls/winex11.drv/event.c  |   10 +++++++---
 dlls/winex11.drv/mouse.c  |   12 +++++++-----
 dlls/winex11.drv/x11drv.h |    1 +
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c
index 6ef1e07..f2e2841 100644
--- a/dlls/winex11.drv/event.c
+++ b/dlls/winex11.drv/event.c
@@ -323,10 +323,14 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next )
         switch (next->type)
         {
         case MotionNotify:
-            if (next->xany.window == x11drv_thread_data()->clip_window)
             {
-                TRACE( "ignoring MotionNotify for clip window\n" );
-                return MERGE_IGNORE;
+                struct x11drv_thread_data *thread_data = x11drv_thread_data();
+                if (next->xany.window == thread_data->clip_window &&
+                    next->xmotion.time - thread_data->last_motion_notify < 1000)
+                {
+                    TRACE( "ignoring MotionNotify for clip window\n" );
+                    return MERGE_IGNORE;
+                }
             }
             break;
         case GenericEvent:
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index 6c56b15..70cdd86 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -547,11 +547,6 @@ static void send_mouse_input( HWND hwnd, Window window, unsigned int state, INPU
         if (thread_data->clip_window != window) return;
         input->u.mi.dx += clip_rect.left;
         input->u.mi.dy += clip_rect.top;
-        if (!(input->u.mi.dwFlags & ~(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE)))
-        {
-            /* motion events are ignored when xinput2 is active */
-            if (thread_data->xi2_state == xi_enabled) return;
-        }
         __wine_send_input( hwnd, input );
         return;
     }
@@ -1366,6 +1361,13 @@ void X11DRV_MotionNotify( HWND hwnd, XEvent *xev )
     input.u.mi.time        = EVENT_x11_time_to_win32_time( event->time );
     input.u.mi.dwExtraInfo = 0;
 
+    if (!hwnd)
+    {
+        struct x11drv_thread_data *thread_data = x11drv_thread_data();
+        if (event->time - thread_data->last_motion_notify < 1000) return;
+        thread_data->last_motion_notify = event->time;
+    }
+
     send_mouse_input( hwnd, event->window, event->state, &input );
 }
 
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index ca7a379..a14fa39 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -548,6 +548,7 @@ struct x11drv_thread_data
     HWND     last_focus;           /* last window that had focus */
     XIM      xim;                  /* input method */
     HWND     last_xic_hwnd;        /* last xic window */
+    Time     last_motion_notify;   /* time of last mouse motion */
     XFontSet font_set;             /* international text drawing font set */
     Window   selection_wnd;        /* window used for selection interactions */
     Window   clip_window;          /* window used for cursor clipping */




More information about the wine-cvs mailing list