1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-07-03 06:24:32 +00:00

fix SDL 1.2 window focus handling

This commit is contained in:
fgenesis 2019-03-24 21:15:27 +01:00
parent 0f0d839fc7
commit 6704fd1ac6
2 changed files with 25 additions and 27 deletions

View file

@ -1063,7 +1063,6 @@ void Core::run(float runTime)
{
if (isWindowFocus())
{
_hasFocus = true;
if (wasInactive)
{
debugLog("WINDOW ACTIVE");
@ -1072,14 +1071,11 @@ void Core::run(float runTime)
}
}
else
{
if (_hasFocus)
{
if (!wasInactive)
debugLog("WINDOW INACTIVE");
wasInactive = true;
_hasFocus = false;
updateInputGrab();
sound->pause();
@ -1105,7 +1101,6 @@ void Core::run(float runTime)
continue;
}
}
}
#endif
old_dt = dt;

View file

@ -123,6 +123,9 @@ void Window::_onEventImpl(const SDL_Event& ev)
case SDL_VIDEORESIZE:
onResize(ev.resize.w, ev.resize.h);
break;
case SDL_ACTIVEEVENT:
_hasFocus = ev.active.state;
}
}