From 86b1c771e14efcc98f8fe07510a4238bf94ced7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Sat, 8 Nov 2014 17:32:37 +0100 Subject: [PATCH] Attempt to fix NS hang. Will probably cause merge conflicts. * nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA. (run): Ditto. Only use non-system event loop if OSX version is exactly 10.9. Fixes: debbugs:18993 --- src/ChangeLog | 6 ++++++ src/nsterm.h | 2 +- src/nsterm.m | 16 +++++++++++++--- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 81e2a27c200..1544df0da8c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-11-08 Jan Djärv + + * nsterm.m (init): Replace OSX 10.9 check with IMPL_COCOA. + (run): Ditto. Only use non-system event loop if OSX version is + exactly 10.9 (Bug#18993). + 2014-11-07 Michael Albinus * callproc.c (encode_current_directory): Support handling of file diff --git a/src/nsterm.h b/src/nsterm.h index eb2165a89d3..cc5ec0d014b 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -100,7 +100,7 @@ typedef float EmacsCGFloat; /* We override sendEvent: as a means to stop/start the event loop */ @interface EmacsApp : NSApplication { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#ifdef NS_IMPL_COCOA BOOL shouldKeepRunning; BOOL isFirst; #endif diff --git a/src/nsterm.m b/src/nsterm.m index 45c6214f0d0..190698db1fe 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4452,7 +4452,7 @@ ns_term_shutdown (int sig) { if (self = [super init]) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#ifdef NS_IMPL_COCOA self->isFirst = YES; #endif #ifdef NS_IMPL_GNUSTEP @@ -4463,9 +4463,19 @@ ns_term_shutdown (int sig) return self; } -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 +#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]; if (isFirst) [self finishLaunching]; @@ -4496,7 +4506,7 @@ ns_term_shutdown (int sig) // The file dialog still leaks 7k - 10k on 10.9 though. [super stop:sender]; } -#endif +#endif /* NS_IMPL_COCOA */ - (void)logNotification: (NSNotification *)notification { -- 2.39.5