winex11: Still process all MotionNotify events when using XInput2.

This commit is contained in:
Alexandre Julliard 2011-11-09 15:45:13 +01:00
parent ef292465be
commit 9716d1c861
3 changed files with 24 additions and 28 deletions

View file

@ -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;
}
break;
#ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
case GenericEvent:
{
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 (prev->xany.window == next->xany.window)
{
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 );
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;
case GenericEvent:
if (prev->xcookie.extension != xinput2_opcode) break;
if (prev->xcookie.evtype != XI_RawMotion) break;
switch (next->type)
{
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;
}
return MERGE_HANDLE;
}

View file

@ -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 );

View file

@ -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 */