DolphinQt: Fix the panic alert deadlock, Pause on Focus Loss edition

why are there so many ways to trigger this issue
This commit is contained in:
JosJuice 2020-05-18 19:38:56 +02:00
parent abe125aea7
commit cc330afa6b
1 changed files with 7 additions and 1 deletions

View File

@ -203,7 +203,13 @@ bool RenderWidget::event(QEvent* event)
break; break;
case QEvent::WindowDeactivate: case QEvent::WindowDeactivate:
if (SConfig::GetInstance().m_PauseOnFocusLost && Core::GetState() == Core::State::Running) if (SConfig::GetInstance().m_PauseOnFocusLost && Core::GetState() == Core::State::Running)
{
// If we are declared as the CPU thread, it means that the real CPU thread is waiting
// for us to finish showing a panic alert (with that panic alert likely being the cause
// of this event), so trying to pause the real CPU thread would cause a deadlock
if (!Core::IsCPUThread())
Core::SetState(Core::State::Paused); Core::SetState(Core::State::Paused);
}
emit FocusChanged(false); emit FocusChanged(false);
break; break;