diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 10 | ||||
| -rw-r--r-- | src/macfont.m | 1 | ||||
| -rw-r--r-- | src/nsterm.h | 2 | ||||
| -rw-r--r-- | src/nsterm.m | 52 |
4 files changed, 43 insertions, 22 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5fec848154b..6733cf176ca 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2014-06-11 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsterm.h (EmacsApp): Always compile in shouldKeepRunning, isFirst | ||
| 4 | on Cocoa. | ||
| 5 | |||
| 6 | * nsterm.m (run): Always compile for Cocoa. Use runtime check to | ||
| 7 | determine 10.9 (Bug#17751). | ||
| 8 | |||
| 9 | * macfont.m (macfont_draw): positions where not freed. | ||
| 10 | |||
| 1 | 2014-06-10 Dmitry Antipov <dmantipov@yandex.ru> | 11 | 2014-06-10 Dmitry Antipov <dmantipov@yandex.ru> |
| 2 | 12 | ||
| 3 | * dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ... | 13 | * dispextern.h (PREPARE_FACE_FOR_DISPLAY): Remove as a duplicate of ... |
diff --git a/src/macfont.m b/src/macfont.m index d34e0332236..9b3cb2c29f6 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -2810,6 +2810,7 @@ macfont_draw (struct glyph_string *s, int from, int to, int x, int y, | |||
| 2810 | 2810 | ||
| 2811 | 2811 | ||
| 2812 | xfree (glyphs); | 2812 | xfree (glyphs); |
| 2813 | xfree (positions); | ||
| 2813 | CGContextRestoreGState (context); | 2814 | CGContextRestoreGState (context); |
| 2814 | 2815 | ||
| 2815 | unblock_input (); | 2816 | unblock_input (); |
diff --git a/src/nsterm.h b/src/nsterm.h index d2c42c553d9..e77aca3d50d 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -100,7 +100,7 @@ typedef float EmacsCGFloat; | |||
| 100 | /* We override sendEvent: as a means to stop/start the event loop */ | 100 | /* We override sendEvent: as a means to stop/start the event loop */ |
| 101 | @interface EmacsApp : NSApplication | 101 | @interface EmacsApp : NSApplication |
| 102 | { | 102 | { |
| 103 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 | 103 | #ifdef NS_IMPL_COCOA |
| 104 | BOOL shouldKeepRunning; | 104 | BOOL shouldKeepRunning; |
| 105 | BOOL isFirst; | 105 | BOOL isFirst; |
| 106 | #endif | 106 | #endif |
diff --git a/src/nsterm.m b/src/nsterm.m index 6b617be4c0d..c6450804f57 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -4453,7 +4453,7 @@ ns_term_shutdown (int sig) | |||
| 4453 | { | 4453 | { |
| 4454 | if (self = [super init]) | 4454 | if (self = [super init]) |
| 4455 | { | 4455 | { |
| 4456 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 | 4456 | #ifdef NS_IMPL_COCOA |
| 4457 | self->isFirst = YES; | 4457 | self->isFirst = YES; |
| 4458 | #endif | 4458 | #endif |
| 4459 | #ifdef NS_IMPL_GNUSTEP | 4459 | #ifdef NS_IMPL_GNUSTEP |
| @@ -4464,30 +4464,40 @@ ns_term_shutdown (int sig) | |||
| 4464 | return self; | 4464 | return self; |
| 4465 | } | 4465 | } |
| 4466 | 4466 | ||
| 4467 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_9 | 4467 | #ifdef NS_IMPL_COCOA |
| 4468 | - (void)run | 4468 | - (void)run |
| 4469 | { | 4469 | { |
| 4470 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | 4470 | #ifndef NSAppKitVersionNumber10_8 |
| 4471 | #define NSAppKitVersionNumber10_8 1187 | ||
| 4472 | #endif | ||
| 4471 | 4473 | ||
| 4472 | if (isFirst) [self finishLaunching]; | 4474 | if (NSAppKitVersionNumber <= NSAppKitVersionNumber10_8) |
| 4473 | isFirst = NO; | 4475 | { |
| 4476 | [super run]; | ||
| 4477 | return; | ||
| 4478 | } | ||
| 4474 | 4479 | ||
| 4475 | shouldKeepRunning = YES; | 4480 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
| 4476 | do | ||
| 4477 | { | ||
| 4478 | [pool release]; | ||
| 4479 | pool = [[NSAutoreleasePool alloc] init]; | ||
| 4480 | |||
| 4481 | NSEvent *event = | ||
| 4482 | [self nextEventMatchingMask:NSAnyEventMask | ||
| 4483 | untilDate:[NSDate distantFuture] | ||
| 4484 | inMode:NSDefaultRunLoopMode | ||
| 4485 | dequeue:YES]; | ||
| 4486 | [self sendEvent:event]; | ||
| 4487 | [self updateWindows]; | ||
| 4488 | } while (shouldKeepRunning); | ||
| 4489 | 4481 | ||
| 4490 | [pool release]; | 4482 | if (isFirst) [self finishLaunching]; |
| 4483 | isFirst = NO; | ||
| 4484 | |||
| 4485 | shouldKeepRunning = YES; | ||
| 4486 | do | ||
| 4487 | { | ||
| 4488 | [pool release]; | ||
| 4489 | pool = [[NSAutoreleasePool alloc] init]; | ||
| 4490 | |||
| 4491 | NSEvent *event = | ||
| 4492 | [self nextEventMatchingMask:NSAnyEventMask | ||
| 4493 | untilDate:[NSDate distantFuture] | ||
| 4494 | inMode:NSDefaultRunLoopMode | ||
| 4495 | dequeue:YES]; | ||
| 4496 | [self sendEvent:event]; | ||
| 4497 | [self updateWindows]; | ||
| 4498 | } while (shouldKeepRunning); | ||
| 4499 | |||
| 4500 | [pool release]; | ||
| 4491 | } | 4501 | } |
| 4492 | 4502 | ||
| 4493 | - (void)stop: (id)sender | 4503 | - (void)stop: (id)sender |
| @@ -4497,7 +4507,7 @@ ns_term_shutdown (int sig) | |||
| 4497 | // The file dialog still leaks 7k - 10k on 10.9 though. | 4507 | // The file dialog still leaks 7k - 10k on 10.9 though. |
| 4498 | [super stop:sender]; | 4508 | [super stop:sender]; |
| 4499 | } | 4509 | } |
| 4500 | #endif | 4510 | #endif /* NS_IMPL_COCOA */ |
| 4501 | 4511 | ||
| 4502 | - (void)logNotification: (NSNotification *)notification | 4512 | - (void)logNotification: (NSNotification *)notification |
| 4503 | { | 4513 | { |