Skip to content

Commit

Permalink
SDL - attempt to fix ValveSoftware/Dota-2#1199 of mouse not locking i…
Browse files Browse the repository at this point in the history
…n Dota. This fix is proposed by Ryan Gordon (increase timeout in X11_SetWindowGrab from 250ms to 5000ms). I'm going to integrate to source2 and ship it to dota customers. If it works, SamL will upsteam it to SDL.
  • Loading branch information
gdrewb-valve committed Apr 6, 2017
1 parent 53f3786 commit 66555f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/x11/SDL_x11window.c
Expand Up @@ -1488,8 +1488,8 @@ X11_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
int attempts;
int result;

/* Try for up to ~250ms to grab. If it still fails, stop trying. */
for (attempts = 0; attempts < 5; attempts++) {
/* 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,
GrabModeAsync, data->xwindow, None, CurrentTime);
if (result == GrabSuccess) {
Expand Down

0 comments on commit 66555f6

Please sign in to comment.