Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #8819 from JosJuice/panic-alert-deadlock-pause-on-…
…focus-loss

DolphinQt: Fix the panic alert deadlock, Pause on Focus Loss edition
  • Loading branch information
JMC47 committed Sep 15, 2020
2 parents 9e3c083 + cc330af commit e0117a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/Core/DolphinQt/RenderWidget.cpp
Expand Up @@ -203,7 +203,13 @@ bool RenderWidget::event(QEvent* event)
break;
case QEvent::WindowDeactivate:
if (SConfig::GetInstance().m_PauseOnFocusLost && Core::GetState() == Core::State::Running)
Core::SetState(Core::State::Paused);
{
// 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);
}

emit FocusChanged(false);
break;
Expand Down

0 comments on commit e0117a8

Please sign in to comment.