summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Frame.cpp
diff options
context:
space:
mode:
authorGerik Kubiak <gerikkub@gmail.com>2015-03-16 20:28:17 -0700
committerGerik Kubiak <gerikkub@gmail.com>2015-03-16 20:28:17 -0700
commit341e7e9d8ff6c77d7eaba4d47e56044203ee80e2 (patch)
tree48087ee96d17c3e530f286b44465f0c44ff4a515 /Source/Core/DolphinWX/Frame.cpp
parent7cda374910ffa9fc9680035ea77083b1cc0d14d9 (diff)
Added the ability to pause the emulator by moving the mouse outside the window.
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
-rw-r--r--Source/Core/DolphinWX/Frame.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp
index ff82e1cd65..3678d349c5 100644
--- a/Source/Core/DolphinWX/Frame.cpp
+++ b/Source/Core/DolphinWX/Frame.cpp
@@ -1121,6 +1121,33 @@ 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)
{