Merge pull request #11211 from jordan-woyak/fix-focus-resume-after-manual-pause
DolphinQt: Fix window focus from unpausing after a manual pause.
This commit is contained in:
commit
8001535d12
|
@ -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,
|
// 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
|
// it's the window that has keyboard and mouse focus
|
||||||
case QEvent::WindowActivate:
|
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);
|
Core::SetState(Core::State::Running);
|
||||||
|
|
||||||
|
m_should_unpause_on_focus = false;
|
||||||
|
|
||||||
UpdateCursor();
|
UpdateCursor();
|
||||||
|
|
||||||
// Avoid "race conditions" with message boxes
|
// Avoid "race conditions" with message boxes
|
||||||
|
@ -425,8 +427,11 @@ bool RenderWidget::event(QEvent* event)
|
||||||
// is waiting for us to finish showing a panic alert (with that panic alert likely being
|
// 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
|
// the cause of this event), so trying to pause the core would cause a deadlock
|
||||||
if (!Core::IsCPUThread() && !Core::IsGPUThread())
|
if (!Core::IsCPUThread() && !Core::IsGPUThread())
|
||||||
|
{
|
||||||
|
m_should_unpause_on_focus = true;
|
||||||
Core::SetState(Core::State::Paused);
|
Core::SetState(Core::State::Paused);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
emit FocusChanged(false);
|
emit FocusChanged(false);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -51,4 +51,5 @@ private:
|
||||||
bool m_lock_cursor_on_next_activation = false;
|
bool m_lock_cursor_on_next_activation = false;
|
||||||
bool m_dont_lock_cursor_on_show = false;
|
bool m_dont_lock_cursor_on_show = false;
|
||||||
bool m_waiting_for_message_box = false;
|
bool m_waiting_for_message_box = false;
|
||||||
|
bool m_should_unpause_on_focus = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue