Check if Mac QSearchField has focus before handling the notification.
Otherwise, playlist's search field will always handle those shortcuts, and they won't work anywhere else on the same window. Fixes #3320.
This commit is contained in:
parent
fad0ccc8c6
commit
fe7bc917de
|
@ -107,6 +107,13 @@ public:
|
|||
|
||||
@implementation QocoaSearchField
|
||||
-(BOOL)performKeyEquivalent:(NSEvent*)event {
|
||||
|
||||
// First, check if we have the focus.
|
||||
// If no, it probably means this event isn't for us.
|
||||
NSResponder* firstResponder = [[NSApp keyWindow] firstResponder];
|
||||
if ([firstResponder isKindOfClass:[NSText class]] &&
|
||||
[(NSText*)firstResponder delegate] == self) {
|
||||
|
||||
if ([event type] == NSKeyDown && [event modifierFlags] & NSCommandKeyMask)
|
||||
{
|
||||
QString keyString = toQString([event characters]);
|
||||
|
@ -135,6 +142,7 @@ public:
|
|||
return YES;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue