From 9716d1c8619e5fe68d1ad3ab9a18b106499b3fac Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 9 Nov 2011 15:45:13 +0100 Subject: [PATCH] winex11: Still process all MotionNotify events when using XInput2. --- dlls/winex11.drv/event.c | 47 +++++++++++++++++++++++------------------------ dlls/winex11.drv/mouse.c | 2 -- dlls/winex11.drv/x11drv.h | 1 - 3 files changed, 23 insertions(+), 27 deletions(-) diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index 00915cfa7e4..1b3478de526 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -310,37 +310,36 @@ static enum event_merge_action merge_events( XEvent *prev, XEvent *next ) } break; case MotionNotify: - if (prev->xany.window == next->xany.window && next->type == MotionNotify) + switch (next->type) { - TRACE( "discarding duplicate MotionNotify for window %lx\n", prev->xany.window ); - return MERGE_DISCARD; + case MotionNotify: + if (prev->xany.window == next->xany.window) + { + TRACE( "discarding duplicate MotionNotify for window %lx\n", prev->xany.window ); + 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; + switch (next->type) { - struct x11drv_thread_data *thread_data = x11drv_thread_data(); - if (prev->xcookie.extension != xinput2_opcode) break; - if (prev->xcookie.evtype != XI_RawMotion) break; - if (thread_data->warp_serial) break; - switch (next->type) - { - case MotionNotify: - 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: - if (next->xcookie.extension != xinput2_opcode) break; - if (next->xcookie.evtype != XI_RawMotion) break; - return merge_raw_motion_events( prev->xcookie.data, next->xcookie.data ); - } + 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_raw_motion_events( prev->xcookie.data, next->xcookie.data ); +#endif } break; -#endif } return MERGE_HANDLE; } diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 112b4cf3919..d4249f4405a 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -1387,9 +1387,7 @@ void X11DRV_MotionNotify( HWND hwnd, XEvent *xev ) if (!hwnd) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); - if (event->time - thread_data->last_motion_notify < 1000) return; if (thread_data->warp_serial && (long)(event->serial - thread_data->warp_serial) < 0) 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 49678664f0d..dbc062979e2 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -548,7 +548,6 @@ 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 */ unsigned long warp_serial; /* serial number of last pointer warp request */ -- 2.11.4.GIT