diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 54dffd3d2..d532d2bdb 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1499,12 +1499,13 @@ X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) if (oldstyle_fullscreen || grabbed) { /* Try to grab the mouse */ if (!data->videodata->broken_pointer_grab) { + const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask; int attempts; int result; /* Try for up to 5000ms (5s) to grab. If it still fails, stop trying. */ for (attempts = 0; attempts < 100; attempts++) { - result = X11_XGrabPointer(display, data->xwindow, True, 0, GrabModeAsync, + result = X11_XGrabPointer(display, data->xwindow, True, mask, GrabModeAsync, GrabModeAsync, data->xwindow, None, CurrentTime); if (result == GrabSuccess) { break;