1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Menu shortcut hiding has been removed

It had been causing problems in Unity for a while now and they
were missing on OSX as well in wx3.  So, the old menu Open/Close
method of hiding has been removed and replaced with an event
filter/monitor which looks for wxEVT_CHAR_HOOK events to pass
key events to the handler that has the keyboard captured.
This commit is contained in:
Leland Lucius
2015-07-28 14:35:09 -05:00
parent 44c9a7b864
commit 5bdfcff97d
19 changed files with 309 additions and 490 deletions

View File

@@ -231,9 +231,6 @@ It handles initialization and termination by subclassing wxApp.
////////////////////////////////////////////////////////////
DEFINE_EVENT_TYPE(EVT_OPEN_AUDIO_FILE);
DEFINE_EVENT_TYPE(EVT_CAPTURE_KEYBOARD);
DEFINE_EVENT_TYPE(EVT_RELEASE_KEYBOARD);
DEFINE_EVENT_TYPE(EVT_CAPTURE_KEY);
#ifdef __WXGTK__
static void wxOnAssert(const wxChar *fileName, int lineNumber, const wxChar *msg)
@@ -1099,16 +1096,16 @@ void AudacityApp::GenerateCrashReport(wxDebugReport::Context ctx)
}
#endif
#if 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
//
int AudacityApp::FilterEvent(wxEvent & event)
{
#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;
@@ -1118,11 +1115,12 @@ int AudacityApp::FilterEvent(wxEvent & event)
((wxWindow *)e.GetEventObject())->SetFocus();
}
}
return -1;
}
break;
#endif
return Event_Skip;
}
AudacityApp::AudacityApp()
{
// Do not capture crashes in debug builds
@@ -1152,11 +1150,6 @@ bool AudacityApp::OnInit()
mChecker = NULL;
mIPCServ = NULL;
#if defined(__WXGTK__)
// Workaround for bug 154 -- initialize to false
inKbdHandler = false;
#endif
#if defined(__WXMAC__)
// Disable window animation
wxSystemOptions::SetOption( wxMAC_WINDOW_PLAIN_TRANSITION, 1 );