From 7c6f07ebe057b11afb7ced553cf2fea3f24bed5f Mon Sep 17 00:00:00 2001 From: Pieter Hulshoff Date: Sat, 6 Aug 2016 10:59:29 +0200 Subject: [PATCH] Added minimize_on_focus_loss parameter to the general setings.conf. Usage: minimize_on_focus_loss = true Usage: minimize_on_focus_loss = false --- RetroFE/Source/SDL.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/RetroFE/Source/SDL.cpp b/RetroFE/Source/SDL.cpp index eeefe60..584d4b6 100644 --- a/RetroFE/Source/SDL.cpp +++ b/RetroFE/Source/SDL.cpp @@ -185,6 +185,19 @@ bool SDL::initialize(Configuration &config) Logger::write(Logger::ZONE_ERROR, "SDL", "Improve scale quality. Continuing with low-quality settings."); } + bool minimize_on_focus_loss_; + if(config.getProperty("minimize_on_focus_loss", minimize_on_focus_loss_)) + { + if(minimize_on_focus_loss_) + { + SDL_SetHintWithPriority(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "1", SDL_HINT_OVERRIDE); + } + else + { + SDL_SetHintWithPriority(SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS, "0", SDL_HINT_OVERRIDE); + } + } + if(retVal) { mutex_ = SDL_CreateMutex();