summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2022-10-25 19:38:46 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2022-10-25 19:39:41 -0500
commit4fc05dd0258895615bebdf79b609c6ed800c20c5 (patch)
tree549ffd764224713dc852e6ffd3da037433d7ba05 /Source/Core
parent060d928d49c3ac5646485dcbffa67affe833076b (diff)
DolphinQt: Fix window focus from unpausing after a manual pause.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt/RenderWidget.cpp7
-rw-r--r--Source/Core/DolphinQt/RenderWidget.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/RenderWidget.cpp b/Source/Core/DolphinQt/RenderWidget.cpp
index a534905056..cb55877ace 100644
--- a/Source/Core/DolphinQt/RenderWidget.cpp
+++ b/Source/Core/DolphinQt/RenderWidget.cpp
@@ -397,9 +397,11 @@ bool RenderWidget::event(QEvent* event)
// Note that this event in Windows is not always aligned to the window that is highlighted,
// it's the window that has keyboard and mouse focus
case QEvent::WindowActivate:
- if (Config::Get(Config::MAIN_PAUSE_ON_FOCUS_LOST) && Core::GetState() == Core::State::Paused)
+ if (m_should_unpause_on_focus && Core::GetState() == Core::State::Paused)
Core::SetState(Core::State::Running);
+ m_should_unpause_on_focus = false;
+
UpdateCursor();
// Avoid "race conditions" with message boxes
@@ -425,7 +427,10 @@ bool RenderWidget::event(QEvent* event)
// 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 core would cause a deadlock
if (!Core::IsCPUThread() && !Core::IsGPUThread())
+ {
+ m_should_unpause_on_focus = true;
Core::SetState(Core::State::Paused);
+ }
}
emit FocusChanged(false);
diff --git a/Source/Core/DolphinQt/RenderWidget.h b/Source/Core/DolphinQt/RenderWidget.h
index c44f673cb2..c8ea1e3a84 100644
--- a/Source/Core/DolphinQt/RenderWidget.h
+++ b/Source/Core/DolphinQt/RenderWidget.h
@@ -51,4 +51,5 @@ private:
bool m_lock_cursor_on_next_activation = false;
bool m_dont_lock_cursor_on_show = false;
bool m_waiting_for_message_box = false;
+ bool m_should_unpause_on_focus = false;
};