From fcab53b3f7ab7cf730ece238ba9fea795a86ef63 Mon Sep 17 00:00:00 2001 From: scrawl Date: Fri, 13 Jun 2014 22:21:44 +0200 Subject: [PATCH] Fix locked mouse cursor due to SDL_SetRelativeMouseMode even when --no-grab was specified --- extern/sdl4ogre/sdlinputwrapper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extern/sdl4ogre/sdlinputwrapper.cpp b/extern/sdl4ogre/sdlinputwrapper.cpp index 82db5ea99f..b9314781e7 100644 --- a/extern/sdl4ogre/sdlinputwrapper.cpp +++ b/extern/sdl4ogre/sdlinputwrapper.cpp @@ -239,9 +239,11 @@ namespace SFO mWrapPointer = false; - //eep, wrap the pointer manually if the input driver doesn't support - //relative positioning natively - bool success = SDL_SetRelativeMouseMode(relative ? SDL_TRUE : SDL_FALSE) == 0; + // eep, wrap the pointer manually if the input driver doesn't support + // relative positioning natively + // also use wrapping if no-grab was specified in options (SDL_SetRelativeMouseMode + // appears to eat the mouse cursor when pausing in a debugger) + bool success = mAllowGrab && SDL_SetRelativeMouseMode(relative ? SDL_TRUE : SDL_FALSE) == 0; if(relative && !success) mWrapPointer = true;