mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-12 06:37:52 +02:00
Bug 2115 - Linux: Track focus lost on selecting effect
This commit is contained in:
parent
72e24b82d2
commit
76c79cb910
@ -1141,50 +1141,6 @@ bool AudacityApp::OnExceptionInMainLoop()
|
||||
#pragma warning( pop )
|
||||
#endif //_MSC_VER
|
||||
|
||||
int AudacityApp::FilterEvent(wxEvent & event)
|
||||
{
|
||||
(void)event;// compiler food (stops unused parameter warning)
|
||||
#if !wxCHECK_VERSION(3, 0, 0) && defined(__WXGTK__)
|
||||
// On wxGTK, there's a focus issue where dialogs do not automatically pass focus
|
||||
// to the first child. This means that you can use the keyboard to navigate within
|
||||
// the dialog. Watching for the ACTIVATE event allows us to set the focus ourselves
|
||||
// when each dialog opens.
|
||||
//
|
||||
// See bug #57
|
||||
//
|
||||
if (event.GetEventType() == wxEVT_ACTIVATE)
|
||||
{
|
||||
wxActivateEvent & e = (wxActivateEvent &) event;
|
||||
|
||||
if (e.GetEventObject() && e.GetActive() && e.GetEventObject()->IsKindOf(CLASSINFO(wxDialog)))
|
||||
{
|
||||
((wxWindow *)e.GetEventObject())->SetFocus();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__WXMAC__) || defined(__WXGTK__)
|
||||
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();
|
||||
#if defined(__WXMAC__)
|
||||
window->NavigateIn();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return Event_Skip;
|
||||
}
|
||||
|
||||
AudacityApp::AudacityApp()
|
||||
{
|
||||
// Do not capture crashes in debug builds
|
||||
|
@ -49,8 +49,6 @@ class AudacityApp final : public wxApp {
|
||||
void OnFatalException() override;
|
||||
bool OnExceptionInMainLoop() override;
|
||||
|
||||
int FilterEvent(wxEvent & event) override;
|
||||
|
||||
// These are currently only used on Mac OS, where it's
|
||||
// possible to have a menu bar but no windows open. It doesn't
|
||||
// hurt any other platforms, though.
|
||||
|
Loading…
x
Reference in New Issue
Block a user