Fix duplicate raw mouse events with XInput2
authorVictor Luchits <vluchits@gmail.com>
Thu, 14 May 2015 14:40:56 +0300
changeset 9614c9c61d66cfa0
parent 9613 5d7389abafec
child 9615 54a796c13658
Fix duplicate raw mouse events with XInput2

Make XGrabPointer calls in X11_SetWindowGrab and X11_CaptureMouse
consistent by passing False to owner_mask along with proper event_mask.
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/x11/SDL_x11window.c	Sat May 23 09:33:20 2015 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Thu May 14 14:40:56 2015 +0300
     1.3 @@ -1329,9 +1329,12 @@
     1.4      if (oldstyle_fullscreen || grabbed) {
     1.5          /* Try to grab the mouse */
     1.6          for (;;) {
     1.7 +            const unsigned int mask = ButtonPressMask | ButtonReleaseMask 
     1.8 +                | PointerMotionMask | FocusChangeMask;
     1.9              int result =
    1.10 -                X11_XGrabPointer(display, data->xwindow, True, 0, GrabModeAsync,
    1.11 -                             GrabModeAsync, data->xwindow, None, CurrentTime);
    1.12 +                X11_XGrabPointer(display, data->xwindow, False, mask, 
    1.13 +                             GrabModeAsync, GrabModeAsync, data->xwindow, 
    1.14 +                             None, CurrentTime);
    1.15              if (result == GrabSuccess) {
    1.16                  break;
    1.17              }