+2014-11-14 David Reitter <david.reitter@gmail.com>
+
+ * nsterm.m (run): set timeout for event loop to prevent hang.
+ (Bug#18993)
+
2014-11-14 Paul Eggert <eggert@cs.ucla.edu>
* .gitignore: Add emacs-[1-9]*, to ignore files like emacs-25.0.50.1.
#ifdef NS_IMPL_COCOA
- (void)run
{
-#ifndef NSAppKitVersionNumber10_9
-#define NSAppKitVersionNumber10_9 1265
-#endif
-
- if ((int)NSAppKitVersionNumber != NSAppKitVersionNumber10_9)
- {
- [super run];
- return;
- }
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[pool release];
pool = [[NSAutoreleasePool alloc] init];
+ /* OSX 10.10.1 swallows the AppDefined event we are sending ourselves
+ in certain situations (rapid incoming events).
+ The timeout we set with untilDate is necessary to prevent a hang.
+ Bug #18993 */
+
NSEvent *event =
[self nextEventMatchingMask:NSAnyEventMask
- untilDate:[NSDate distantFuture]
+ untilDate:[NSDate dateWithTimeIntervalSinceNow:0.5]
inMode:NSDefaultRunLoopMode
dequeue:YES];
- [self sendEvent:event];
+
+ if (event == nil) // timeout
+ shouldKeepRunning = NO;
+ else
+ [self sendEvent:event];
+
[self updateWindows];
} while (shouldKeepRunning);