Bug1196: Don't trap focus in modal dialogs in alt+f6 cycle

This fix is good for Mac only, but maybe the same could apply to Linux.

See also commit a00f866b54

That commit fixed, e.g., alt+f6 cycling between the main window and the splash
dialog when starting Audacity.  However, alt+tab to switch applications, then
again to return to Audacity, still trapped you.

This further change eliminates the other trap.

Perhaps the conditional compilation #ifdef __WXMAC__ in these two commits
could be broadened to cover Linux and the bug will be fixed there too.
This commit is contained in:
Paul Licameli 2016-06-21 18:29:00 -04:00
parent 8ad9fd257c
commit 58e3f3da83

View File

@ -1133,6 +1133,22 @@ int AudacityApp::FilterEvent(wxEvent & event)
}
#endif
#ifdef __WXMAC__
if (event.GetEventType() == wxEVT_ACTIVATE)
{
wxActivateEvent & e = static_cast<wxActivateEvent &>(event);
const auto object = e.GetEventObject();
if (object && e.GetActive() &&
object->IsKindOf(CLASSINFO(wxWindow)))
{
const auto window = ((wxWindow *)e.GetEventObject());
window->SetFocus();
window->NavigateIn();
}
}
#endif
return Event_Skip;
}