Change window focus handling (disable input grab when focus lost)

This commit is contained in:
def 2016-05-06 11:29:34 +02:00
parent 939f2136c0
commit f2100fbad7

View file

@ -249,7 +249,12 @@ int CInput::Update()
case SDL_WINDOWEVENT_FOCUS_LOST:
m_MouseFocus = false;
IgnoreKeys = true;
SDL_SetRelativeMouseMode(SDL_FALSE);
if(m_InputGrabbed)
{
MouseModeAbsolute();
// Remember that we had relative mouse
m_InputGrabbed = true;
}
break;
#if defined(CONF_PLATFORM_MACOSX) // Todo: remove this when fixed in SDL
case SDL_WINDOWEVENT_MAXIMIZED: