From 42fc1cdc1c7149a4649303b42beb4cf6e24a4302 Mon Sep 17 00:00:00 2001 From: abma Date: Sat, 17 Sep 2016 03:07:04 +0200 Subject: [PATCH] add config MinimizeOnFocusLoss: When set to 1 minimize Window if it loses key focus when in fullscreen mode. fix #5323 --- rts/Rendering/GlobalRendering.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rts/Rendering/GlobalRendering.cpp b/rts/Rendering/GlobalRendering.cpp index 548f88f3f06..639656643bd 100644 --- a/rts/Rendering/GlobalRendering.cpp +++ b/rts/Rendering/GlobalRendering.cpp @@ -28,6 +28,7 @@ CONFIG(bool, TeamNanoSpray).defaultValue(true).headlessValue(false); CONFIG(int, SmoothLines).defaultValue(2).headlessValue(0).safemodeValue(0).minimumValue(0).maximumValue(3).description("Smooth lines.\n 0 := off\n 1 := fastest\n 2 := don't care\n 3 := nicest"); CONFIG(int, SmoothPoints).defaultValue(2).headlessValue(0).safemodeValue(0).minimumValue(0).maximumValue(3).description("Smooth points.\n 0 := off\n 1 := fastest\n 2 := don't care\n 3 := nicest"); CONFIG(float, TextureLODBias).defaultValue(0.0f).minimumValue(-4.0f).maximumValue(4.0f); +CONFIG(int, MinimizeOnFocusLoss).defaultValue(0).minimumValue(0).maximumValue(1).description("When set to 1 minimize Window if it loses key focus when in fullscreen mode."); /** * @brief global rendering @@ -247,6 +248,11 @@ bool CGlobalRendering::CreateSDLWindow(const char* title) return false; } + const int autominimize = configHandler->GetInt("MinimizeOnFocusLoss"); + if (autominimize == 0) { + SDL_SetHint(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0"); + } + #if defined(WIN32) if (borderless && !fullScreen) { WindowManagerHelper::SetWindowResizable(window, !borderless);