diff --git a/src/client/vid/glimp_sdl.c b/src/client/vid/glimp_sdl.c index 5c4c9899..36cfbdcc 100755 --- a/src/client/vid/glimp_sdl.c +++ b/src/client/vid/glimp_sdl.c @@ -89,6 +89,15 @@ CreateSDLWindow(int flags, int w, int h) last_position_x = last_position_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY((int)vid_displayindex->value); } + /* Force the window to minimize when focus is lost. This was the + * default behavior until SDL 2.0.12 and changed with 2.0.14. + * The windows staying maximized has some odd implications for + * window ordering under Windows and some X11 window managers + * like kwin. See: + * * https://github.com/libsdl-org/SDL/issues/4039 + * * https://github.com/libsdl-org/SDL/issues/3656 */ + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1"); + window = SDL_CreateWindow("Yamagi Quake II", last_position_x, last_position_y, w, h, flags); if (window)