diff --git a/desktop_version/src/KeyPoll.cpp b/desktop_version/src/KeyPoll.cpp index 75992cb0..a9cccbe7 100644 --- a/desktop_version/src/KeyPoll.cpp +++ b/desktop_version/src/KeyPoll.cpp @@ -248,6 +248,7 @@ void KeyPoll::Poll() SDL_SetWindowFullscreen(window, 0); } SDL_DisableScreenSaver(); + resetWindow = true; } else if (evt.window.event == SDL_WINDOWEVENT_FOCUS_LOST) { @@ -260,16 +261,19 @@ void KeyPoll::Poll() ); } SDL_EnableScreenSaver(); + resetWindow = true; } /* Mouse Focus */ else if (evt.window.event == SDL_WINDOWEVENT_ENTER) { SDL_DisableScreenSaver(); + resetWindow = true; } else if (evt.window.event == SDL_WINDOWEVENT_LEAVE) { SDL_EnableScreenSaver(); + resetWindow = true; } } diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index d634427c..a631f5a4 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -553,11 +553,11 @@ int main(int argc, char *argv[]) Mix_Volume(-1,MIX_MAX_VOLUME); } - if(key.resetWindow) - { - key.resetWindow = false; - gameScreen.ResizeScreen(-1, -1); - } + if (key.resetWindow) + { + key.resetWindow = false; + gameScreen.ResizeScreen(-1, -1); + } music.processmusic(); graphics.processfade();