Skip to content

Commit

Permalink
Fix game crash when alt tabbing (#37159)
Browse files Browse the repository at this point in the history
  • Loading branch information
8street authored and ZhilkinSerg committed Jan 19, 2020
1 parent da23951 commit fd8c0cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sdltiles.cpp
Original file line number Diff line number Diff line change
@@ -379,6 +379,8 @@ static void WinCreate()
#if !defined(__ANDROID__)
if( get_option<std::string>( "FULLSCREEN" ) == "fullscreen" ) {
window_flags |= SDL_WINDOW_FULLSCREEN;
fullscreen = true;
SDL_SetHint( SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0" );
} else if( get_option<std::string>( "FULLSCREEN" ) == "windowedbl" ) {
window_flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
fullscreen = true;
@@ -2864,6 +2866,14 @@ static void CheckMessages()
#endif
case SDL_WINDOWEVENT_SHOWN:
case SDL_WINDOWEVENT_EXPOSED:
case SDL_WINDOWEVENT_MINIMIZED:
break;
case SDL_WINDOWEVENT_FOCUS_GAINED:
// Main menu redraw
reinitialize_framebuffer();
// TODO: redraw all game menus if they are open
needupdate = true;
break;
case SDL_WINDOWEVENT_RESTORED:
needupdate = true;
#if defined(__ANDROID__)

0 comments on commit fd8c0cb

Please sign in to comment.