From 12e22dd5a5b851b24fbf4bf99ef0ecd19d289b68 Mon Sep 17 00:00:00 2001 From: "smichaud%pobox.com" Date: Wed, 20 Aug 2008 15:12:39 +0000 Subject: [PATCH] Some keyboard shortcuts can fail after switching tabs. b=428405 r=josh sr=roc a=ss git-svn-id: svn://10.0.0.236/trunk@253721 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/cocoa/nsChildView.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mozilla/widget/src/cocoa/nsChildView.mm b/mozilla/widget/src/cocoa/nsChildView.mm index cb5cf790b57..e06973759af 100644 --- a/mozilla/widget/src/cocoa/nsChildView.mm +++ b/mozilla/widget/src/cocoa/nsChildView.mm @@ -5388,12 +5388,16 @@ static BOOL keyUpAlreadySentKeyDown = NO; nsAutoRetainCocoaObject kungFuDeathGrip(self); - // if we aren't the first responder, pass the event on + // If we're not the first responder and the first responder is an NSView + // object, pass the event on. Otherwise (if, for example, the first + // responder is an NSWindow object) we should trust the OS to have called + // us correctly. id firstResponder = [[self window] firstResponder]; if (firstResponder != self) { + // Special handling if the other first responder is a ChildView. if ([firstResponder isKindOfClass:[ChildView class]]) return [(ChildView *)firstResponder performKeyEquivalent:theEvent]; - else + if ([firstResponder isKindOfClass:[NSView class]]) return [super performKeyEquivalent:theEvent]; }