Disable unfocus on Emscripten

This commit is contained in:
leo60228
2021-03-31 15:12:13 -04:00
committed by Misa Elizabeth Kai
parent 0063e1c3bc
commit 46ee84d6ef

View File

@@ -347,6 +347,8 @@ void KeyPoll::Poll(void)
SDL_DisableScreenSaver(); SDL_DisableScreenSaver();
break; break;
case SDL_WINDOWEVENT_FOCUS_LOST: case SDL_WINDOWEVENT_FOCUS_LOST:
// For some reason, SDL_WINDOWEVENT_FOCUS_GAINED doesn't seem to get sent on Emscripten.
#ifndef __EMSCRIPTEN__
if (!game.disablepause) if (!game.disablepause)
{ {
isActive = false; isActive = false;
@@ -356,6 +358,8 @@ void KeyPoll::Poll(void)
music.pauseef(); music.pauseef();
} }
} }
#endif
if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0)
{ {
wasFullscreen = !graphics.screenbuffer->isWindowed; wasFullscreen = !graphics.screenbuffer->isWindowed;