Skip to content

Commit

Permalink
add config MinimizeOnFocusLoss:
Browse files Browse the repository at this point in the history
When set to 1 minimize Window if it loses key focus when in fullscreen mode.
fix #5323
  • Loading branch information
abma committed Sep 17, 2016
1 parent ded04ec commit 42fc1cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions rts/Rendering/GlobalRendering.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 42fc1cd

Please sign in to comment.