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

This commit is contained in:
Alexandre Julliard 2011-05-13 16:19:45 +02:00
parent fd4ad5a604
commit 8e9b4e0a5c
3 changed files with 15 additions and 8 deletions

View File

@ -323,11 +323,15 @@ 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)
{
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:
if (next->xcookie.extension != xinput2_opcode) break;

View File

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

View File

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