From 88d15c6ec862165e45e0a161db5f432f2a77a749 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sat, 4 Mar 2017 21:16:14 -0800 Subject: [PATCH] partial fix for disabling pausing when linked #83 Check if link mode is active in GameArea::Pause() and refuse to pause if it is. Remove the check for the app not having focus with pauseWhenInactive enabled in GameArea::OnIdle() as this is now handled in MainFrame::OnActivate() (which receives focus events) since f10e2e99. Revert 13f5afa9 which tried to check for link status in MainFrame::MenuPopped() because it was completely wrong and the link check is better done in GameArea::Pause(). --- src/wx/panel.cpp | 8 +++++++- src/wx/wxvbam.cpp | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index 891c9af2..60a6c6e0 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -922,6 +922,12 @@ void GameArea::Pause() if (paused) return; + // don't pause when linked +#ifndef NO_LINK + if (GetLinkMode() != LINK_DISCONNECTED) + return; +#endif + paused = was_paused = true; if (loaded != IMAGE_UNKNOWN) @@ -1039,7 +1045,7 @@ void GameArea::OnIdle(wxIdleEvent& event) w->Connect(wxEVT_SIZE, wxSizeEventHandler(GameArea::OnSize), NULL, this); } - if (!paused && (!pauseWhenInactive || wxGetApp().frame->HasFocus())) { + if (!paused) { HidePointer(); event.RequestMore(); diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp index 017f2a50..47ffd973 100644 --- a/src/wx/wxvbam.cpp +++ b/src/wx/wxvbam.cpp @@ -871,8 +871,7 @@ void MainFrame::MenuPopped(wxMenuEvent& evt) if (popped) panel->ShowPointer(); - // don't pause on menu when link is active #83 - if (menus_opened && !gba_joybus_active) + if (menus_opened) panel->Pause(); else if (!IsPaused()) panel->Resume();