|
@@ -1499,12 +1499,13 @@ X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
|
|
if (oldstyle_fullscreen || grabbed) {
|
|
if (oldstyle_fullscreen || grabbed) {
|
|
/* Try to grab the mouse */
|
|
/* Try to grab the mouse */
|
|
if (!data->videodata->broken_pointer_grab) {
|
|
if (!data->videodata->broken_pointer_grab) {
|
|
|
|
+ const unsigned int mask = ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask;
|
|
int attempts;
|
|
int attempts;
|
|
int result;
|
|
int result;
|
|
|
|
|
|
/* Try for up to 5000ms (5s) to grab. If it still fails, stop trying. */
|
|
/* Try for up to 5000ms (5s) to grab. If it still fails, stop trying. */
|
|
for (attempts = 0; attempts < 100; attempts++) {
|
|
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);
|
|
GrabModeAsync, data->xwindow, None, CurrentTime);
|
|
if (result == GrabSuccess) {
|
|
if (result == GrabSuccess) {
|
|
break;
|
|
break;
|