fixed #885 (detected settings display overwritten by auto pause)

This commit is contained in:
Thomas Jentzsch 2022-04-03 19:55:42 +02:00
parent fc2ae0c585
commit edef47b4ed
3 changed files with 23 additions and 1 deletions

View File

@ -380,7 +380,8 @@ void EventHandler::handleSystemEvent(SystemEvent e, int, int)
break;
case SystemEvent::WINDOW_FOCUS_LOST:
if(myOSystem.settings().getBool("autopause") && myState == EventHandlerState::EMULATION)
if(myOSystem.settings().getBool("autopause") && myState == EventHandlerState::EMULATION
&& myOSystem.launcherLostFocus())
setState(EventHandlerState::PAUSE);
break;

View File

@ -587,9 +587,20 @@ bool OSystem::createLauncher(const string& startdir)
#endif
myLauncherUsed = myLauncherUsed || status;
myLauncherLostFocus = !status;
return status;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool OSystem::launcherLostFocus()
{
if(myLauncherLostFocus)
return true;
myLauncherLostFocus = true;
return false;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string OSystem::getROMInfo(const FilesystemNode& romfile)
{

View File

@ -379,6 +379,13 @@ class OSystem
*/
bool launcherUsed() const { return myLauncherUsed; }
/**
Answers whether the ROM launcher has lost focus after starting emulation.
@return True if launcher has lost focus, otherwise false
*/
bool launcherLostFocus();
/**
Gets all possible info about the ROM by creating a temporary
Console object and querying it.
@ -564,6 +571,9 @@ class OSystem
// Indicates whether ROM launcher was ever opened during this run
bool myLauncherUsed{false};
// Indicates whether ROM launcher has focus after starting emulation
bool myLauncherLostFocus{true};
// Indicates whether to stop the main loop
bool myQuitLoop{false};