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().
This commit is contained in:
Rafael Kitover 2017-03-04 21:16:14 -08:00
parent d1918c12f4
commit 88d15c6ec8
2 changed files with 8 additions and 3 deletions

View File

@ -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();

View File

@ -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();