From 272a8fc0163137587f8093ab1100a4e93378da2d Mon Sep 17 00:00:00 2001 From: Josh Aas Date: Sat, 19 Feb 2011 00:24:00 -0800 Subject: [PATCH] Bug 634387 - "[Mac] Firefox 4.0b12pre crash in mozilla::plugins::PPluginInstanceChild::FatalError [@ mozalloc_abort | NS_DebugBreak_P] opening a tab with Cmd-T while a Flash video has focus (youtube)" [r=smichaud, a=hardblocker] --- widget/src/cocoa/nsChildView.mm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 738e4375075e..63673ccdc998 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -5761,17 +5761,19 @@ static const char* ToEscapedString(NSString* aString, nsCAutoString& aBuf) [self convertCocoaKeyEvent:theEvent toGeckoEvent:&geckoEvent]; // create event for use by plugins + if (mIsPluginView) { #ifndef NP_NO_CARBON - EventRecord carbonEvent; - if (mPluginEventModel == NPEventModelCarbon) { - ConvertCocoaKeyEventToCarbonEvent(theEvent, carbonEvent, message); - geckoEvent.pluginEvent = &carbonEvent; - } + EventRecord carbonEvent; + if (mPluginEventModel == NPEventModelCarbon) { + ConvertCocoaKeyEventToCarbonEvent(theEvent, carbonEvent, message); + geckoEvent.pluginEvent = &carbonEvent; + } #endif - NPCocoaEvent cocoaEvent; - if (mPluginEventModel == NPEventModelCocoa) { - ConvertCocoaKeyEventToNPCocoaEvent(theEvent, cocoaEvent, message); - geckoEvent.pluginEvent = &cocoaEvent; + NPCocoaEvent cocoaEvent; + if (mPluginEventModel == NPEventModelCocoa) { + ConvertCocoaKeyEventToNPCocoaEvent(theEvent, cocoaEvent, message); + geckoEvent.pluginEvent = &cocoaEvent; + } } mGeckoChild->DispatchWindowEvent(geckoEvent);