diff --git a/src/nsterm.m b/src/nsterm.m
index a57e744..324f065 100644
|
|
ns_read_socket (struct terminal *terminal, struct input_event *hold_quit) |
3373 | 3373 | if ([NSApp modalWindow] != nil) |
3374 | 3374 | return -1; |
3375 | 3375 | |
3376 | | if (hold_event_q.nr > 0) |
| 3376 | if (hold_event_q.nr > 0) |
3377 | 3377 | { |
3378 | 3378 | int i; |
3379 | 3379 | for (i = 0; i < hold_event_q.nr; ++i) |
… |
… |
ns_select (int nfds, fd_set *readfds, fd_set *writefds, |
3447 | 3447 | |
3448 | 3448 | /* NSTRACE (ns_select); */ |
3449 | 3449 | |
3450 | | if (hold_event_q.nr > 0) |
| 3450 | if (hold_event_q.nr > 0) |
3451 | 3451 | { |
3452 | 3452 | /* We already have events pending. */ |
3453 | 3453 | kill (0, SIGIO); |
… |
… |
ns_term_shutdown (int sig) |
4270 | 4270 | |
4271 | 4271 | @implementation EmacsApp |
4272 | 4272 | |
| 4273 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 |
| 4274 | - (id)init |
| 4275 | { |
| 4276 | if (self = [super init]) |
| 4277 | self->isFirst = YES; |
| 4278 | |
| 4279 | return self; |
| 4280 | } |
| 4281 | |
| 4282 | - (void)run |
| 4283 | { |
| 4284 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
| 4285 | |
| 4286 | if (isFirst) [self finishLaunching]; |
| 4287 | isFirst = NO; |
| 4288 | |
| 4289 | shouldKeepRunning = YES; |
| 4290 | do |
| 4291 | { |
| 4292 | [pool release]; |
| 4293 | pool = [[NSAutoreleasePool alloc] init]; |
| 4294 | |
| 4295 | NSEvent *event = |
| 4296 | [self nextEventMatchingMask:NSAnyEventMask |
| 4297 | untilDate:[NSDate distantFuture] |
| 4298 | inMode:NSDefaultRunLoopMode |
| 4299 | dequeue:YES]; |
| 4300 | [self sendEvent:event]; |
| 4301 | [self updateWindows]; |
| 4302 | } while (shouldKeepRunning); |
| 4303 | |
| 4304 | [pool release]; |
| 4305 | } |
| 4306 | |
| 4307 | - (void)stop: (id)sender |
| 4308 | { |
| 4309 | shouldKeepRunning = NO; |
| 4310 | // Stop possible dialog also. Noop if no dialog present. |
| 4311 | // The file dialog still leaks 7k - 10k on 10.9 though. |
| 4312 | [super stop:sender]; |
| 4313 | } |
| 4314 | #endif |
| 4315 | |
4273 | 4316 | - (void)logNotification: (NSNotification *)notification |
4274 | 4317 | { |
4275 | 4318 | const char *name = [[notification name] UTF8String]; |