From a3f387200e15be7afd82dd54a5943f524a87ba6e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 9 Apr 2014 14:24:58 -0400 Subject: [PATCH] XINPUT2 support check reable check for x11 and check if XINPUT2 support before enable mouse grab mode TODO: need to restore non-mousegrab code? --- src/sdl2/i_video.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sdl2/i_video.c b/src/sdl2/i_video.c index a6f56a54e..8c6721657 100644 --- a/src/sdl2/i_video.c +++ b/src/sdl2/i_video.c @@ -1983,13 +1983,14 @@ void I_StartupGraphics(void) } if (M_CheckParm("-nomousegrab")) mousegrabok = SDL_FALSE; -#if 0 // defined (_DEBUG) +#if 1 // defined (_DEBUG) else { char videodriver[4] = {'S','D','L',0}; if (!M_CheckParm("-mousegrab") && - SDL_VideoDriverName(videodriver,4) && - strncasecmp("X11",videodriver,4) == 0) + *strncpy(videodriver, SDL_GetCurrentVideoDriver(), 4) != '\0' && + strncasecmp("x11",videodriver,4) == 0 && + SDL_SetRelativeMouseMode(1) == -1) mousegrabok = SDL_FALSE; //X11's XGrabPointer not good } #endif