From 46ee84d6ef2faf4e14e85193041a19001e0793d9 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Wed, 31 Mar 2021 15:12:13 -0400 Subject: [PATCH] Disable unfocus on Emscripten --- desktop_version/src/KeyPoll.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/desktop_version/src/KeyPoll.cpp b/desktop_version/src/KeyPoll.cpp index bce3720e..954432bb 100644 --- a/desktop_version/src/KeyPoll.cpp +++ b/desktop_version/src/KeyPoll.cpp @@ -347,6 +347,8 @@ void KeyPoll::Poll(void) SDL_DisableScreenSaver(); break; 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) { isActive = false; @@ -356,6 +358,8 @@ void KeyPoll::Poll(void) music.pauseef(); } } +#endif + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { wasFullscreen = !graphics.screenbuffer->isWindowed;