mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Change behavior so emulation is paused when window focus is lost.
This commit is contained in:
@ -1121,33 +1121,6 @@ void CFrame::OnKeyUp(wxKeyEvent& event)
|
||||
|
||||
void CFrame::OnMouse(wxMouseEvent& event)
|
||||
{
|
||||
if (SConfig::GetInstance().m_PauseOnFocusLost &&
|
||||
event.GetEventObject() == (wxObject*)m_RenderParent)
|
||||
{
|
||||
if (event.Leaving())
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_RUN)
|
||||
{
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
Core::UpdateTitle();
|
||||
}
|
||||
UpdateGUI();
|
||||
}
|
||||
else if (event.Entering())
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_PAUSE)
|
||||
{
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
}
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// next handlers are all for FreeLook, so we don't need to check them if disabled
|
||||
if (!g_Config.bFreeLook)
|
||||
{
|
||||
@ -1203,6 +1176,35 @@ void CFrame::OnMouse(wxMouseEvent& event)
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void CFrame::OnFocusChange(wxFocusEvent& event)
|
||||
{
|
||||
if (SConfig::GetInstance().m_PauseOnFocusLost)
|
||||
{
|
||||
if (RendererHasFocus())
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_PAUSE)
|
||||
{
|
||||
Core::SetState(Core::CORE_RUN);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
}
|
||||
UpdateGUI();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Core::GetState() == Core::CORE_RUN)
|
||||
{
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
Core::UpdateTitle();
|
||||
}
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CFrame::DoFullscreen(bool enable_fullscreen)
|
||||
{
|
||||
if (g_Config.bExclusiveMode && Core::GetState() == Core::CORE_PAUSE)
|
||||
|
Reference in New Issue
Block a user