SDL - attempt to fix https://github.com/ValveSoftware/Dota-2/issues/1199 of mouse not locking in 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.
authorDrew Bliss <drewb@valvesoftware.com>
Thu, 06 Apr 2017 13:27:48 -0700
changeset 1096450b8ed4e6266
parent 10963 c1f32e587365
child 10965 dc566389a248
SDL - attempt to fix https://github.com/ValveSoftware/Dota-2/issues/1199 of mouse not locking in 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.
src/video/x11/SDL_x11window.c
     1.1 --- a/src/video/x11/SDL_x11window.c	Tue Apr 04 08:43:44 2017 -0700
     1.2 +++ b/src/video/x11/SDL_x11window.c	Thu Apr 06 13:27:48 2017 -0700
     1.3 @@ -1488,8 +1488,8 @@
     1.4              int attempts;
     1.5              int result;
     1.6  
     1.7 -            /* Try for up to ~250ms to grab. If it still fails, stop trying. */
     1.8 -            for (attempts = 0; attempts < 5; attempts++) {
     1.9 +            /* Try for up to 5000ms (5s) to grab. If it still fails, stop trying. */
    1.10 +            for (attempts = 0; attempts < 100; attempts++) {
    1.11                  result = X11_XGrabPointer(display, data->xwindow, True, 0, GrabModeAsync,
    1.12                                   GrabModeAsync, data->xwindow, None, CurrentTime);
    1.13                  if (result == GrabSuccess) {