summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2020-09-15 11:46:46 -0400
committerGitHub <noreply@github.com>2020-09-15 11:46:46 -0400
commite0117a86adf0d1bea5bbec0aa335895d759d332a (patch)
treeea8f91f32c953a925f6bf514f42907ffec81df55 /Source
parent9e3c08394ad6c05232dbacf7f1745570b5e2b48a (diff)
parentcc330afa6bc7da0bce00e2d4de68ff13315f1e96 (diff)
Merge pull request #8819 from JosJuice/panic-alert-deadlock-pause-on-focus-loss
DolphinQt: Fix the panic alert deadlock, Pause on Focus Loss edition
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/RenderWidget.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/RenderWidget.cpp b/Source/Core/DolphinQt/RenderWidget.cpp
index c6bc0d414a..bef9c10cbe 100644
--- a/Source/Core/DolphinQt/RenderWidget.cpp
+++ b/Source/Core/DolphinQt/RenderWidget.cpp
@@ -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;