1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-22 06:22:58 +02:00

Bug1252: Ctrl-f6 cycle works on Mac even when combo has focus

This commit is contained in:
Paul Licameli
2016-06-23 10:35:45 -04:00
parent a871257158
commit e9cf0a8335

View File

@@ -158,14 +158,22 @@ public:
{ {
return FilterEvent(wxevent) == Event_Processed ? nil : event; return FilterEvent(wxevent) == Event_Processed ? nil : event;
} }
mEvent = nullptr;
} }
} }
return event; return event;
} }
]; ];
#else
// Bug1252: must also install this filter with wxWidgets, else
// we don't intercept command keys when focus is in a combo box.
wxEvtHandler::AddFilter(this); wxEvtHandler::AddFilter(this);
#else
wxEvtHandler::AddFilter(this);
#endif #endif
} }
@@ -178,7 +186,7 @@ public:
#endif #endif
} }
int FilterEvent(wxEvent& event) int FilterEvent(wxEvent& event) override
{ {
// Quickly bail if this isn't something we want. // Quickly bail if this isn't something we want.
wxEventType type = event.GetEventType(); wxEventType type = event.GetEventType();
@@ -317,6 +325,15 @@ private:
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
if (!mEvent) {
// TODO: we got here without getting the NSEvent pointer,
// as in the combo box case of bug 1252. We can't compute it!
// This makes a difference only when there is a capture handler.
// It's never the case yet that there is one.
wxASSERT(false);
return chars;
}
NSString *c = [mEvent charactersIgnoringModifiers]; NSString *c = [mEvent charactersIgnoringModifiers];
if ([c length] == 1) if ([c length] == 1)
{ {
@@ -382,7 +399,7 @@ private:
#if defined(__WXMAC__) #if defined(__WXMAC__)
id mHandler; id mHandler;
NSEvent *mEvent; NSEvent *mEvent {};
UInt32 mDeadKeyState; UInt32 mDeadKeyState;
#endif #endif