Skip to content

Commit

Permalink
Fix duplicate raw mouse events with XInput2
Browse files Browse the repository at this point in the history
Make XGrabPointer calls in X11_SetWindowGrab and X11_CaptureMouse
consistent by passing False to owner_mask along with proper event_mask.
  • Loading branch information
viciious committed May 14, 2015
1 parent 4471949 commit afc97cb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/video/x11/SDL_x11window.c
Expand Up @@ -1329,9 +1329,12 @@ X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
if (oldstyle_fullscreen || grabbed) {
/* Try to grab the mouse */
for (;;) {
const unsigned int mask = ButtonPressMask | ButtonReleaseMask
| PointerMotionMask | FocusChangeMask;
int result =
X11_XGrabPointer(display, data->xwindow, True, 0, GrabModeAsync,
GrabModeAsync, data->xwindow, None, CurrentTime);
X11_XGrabPointer(display, data->xwindow, False, mask,
GrabModeAsync, GrabModeAsync, data->xwindow,
None, CurrentTime);
if (result == GrabSuccess) {
break;
}
Expand Down

0 comments on commit afc97cb

Please sign in to comment.