Workaround for SDL 2.0.14 alt-tab bug (#105)

* Workaround for SDL 2.0.14 alt-tab bug

* Add run-time and build-time check

* Add block scope
This commit is contained in:
Roman Fomin 2021-01-20 16:52:40 +07:00 committed by GitHub
parent 841d53053e
commit cb98e17d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1208,6 +1208,18 @@ static void I_InitGraphicsMode(void)
SDL_TEXTUREACCESS_STREAMING,
v_w, v_h);
// Workaround for SDL 2.0.14 alt-tab bug (taken from Doom Retro)
#if defined(_WIN32)
{
SDL_version ver;
SDL_GetVersion(&ver);
if (ver.major == 2 && ver.minor == 0 && ver.patch == 14)
{
SDL_SetHintWithPriority(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1", SDL_HINT_OVERRIDE);
}
}
#endif
V_Init();
UpdateGrab();