Bug 705154 - Hang monitor incorrectly killing the app on mac when the user is idle: unlike other platforms, the main loop on Mac doesn't call processNextEvent in a loop: instead it calls into [NSApplication run] and we check whether there are pending XPCOM events during processing. Suspend the hang monitor when we pause for incoming events by subclassing [NSApplication nextEventMatchingMask], r=smichaud

--HG--
extra : rebase_source : 753343ca11d3ce8b6801a5be8831621887fbe70b
This commit is contained in:
Benjamin Smedberg 2011-12-01 12:50:04 -05:00
Родитель 9996a556df
Коммит 3f3740d7ab
1 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -183,6 +183,7 @@ bool nsCocoaAppModalWindowList::GeckoModalAboveCocoaModal()
@end
@implementation GeckoNSApplication
- (void)sendEvent:(NSEvent *)anEvent
{
mozilla::HangMonitor::NotifyActivity();
@ -193,6 +194,19 @@ bool nsCocoaAppModalWindowList::GeckoModalAboveCocoaModal()
}
[super sendEvent:anEvent];
}
- (NSEvent*)nextEventMatchingMask:(NSUInteger)mask
untilDate:(NSDate*)expiration
inMode:(NSString*)mode
dequeue:(BOOL)flag
{
if (expiration) {
mozilla::HangMonitor::Suspend();
}
return [super nextEventMatchingMask:mask
untilDate:expiration inMode:mode dequeue:flag];
}
@end