diff options
Diffstat (limited to 'src/nsmenu.m')
| -rw-r--r-- | src/nsmenu.m | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m index 778b068ef8b..a90cb970874 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m | |||
| @@ -492,11 +492,9 @@ void | |||
| 492 | x_activate_menubar (struct frame *f) | 492 | x_activate_menubar (struct frame *f) |
| 493 | { | 493 | { |
| 494 | #ifdef NS_IMPL_COCOA | 494 | #ifdef NS_IMPL_COCOA |
| 495 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 | ||
| 496 | ns_update_menubar (f, true, nil); | 495 | ns_update_menubar (f, true, nil); |
| 497 | ns_check_pending_open_menu (); | 496 | ns_check_pending_open_menu (); |
| 498 | #endif | 497 | #endif |
| 499 | #endif | ||
| 500 | } | 498 | } |
| 501 | 499 | ||
| 502 | 500 | ||
| @@ -542,23 +540,14 @@ x_activate_menubar (struct frame *f) | |||
| 542 | } | 540 | } |
| 543 | 541 | ||
| 544 | #ifdef NS_IMPL_COCOA | 542 | #ifdef NS_IMPL_COCOA |
| 545 | #if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5 | ||
| 546 | extern NSString *NSMenuDidBeginTrackingNotification; | ||
| 547 | #endif | ||
| 548 | #endif | ||
| 549 | |||
| 550 | #ifdef NS_IMPL_COCOA | ||
| 551 | -(void)trackingNotification:(NSNotification *)notification | 543 | -(void)trackingNotification:(NSNotification *)notification |
| 552 | { | 544 | { |
| 553 | /* Update menu in menuNeedsUpdate only while tracking menus. */ | 545 | /* Update menu in menuNeedsUpdate only while tracking menus. */ |
| 554 | trackingMenu = ([notification name] == NSMenuDidBeginTrackingNotification | 546 | trackingMenu = ([notification name] == NSMenuDidBeginTrackingNotification |
| 555 | ? 1 : 0); | 547 | ? 1 : 0); |
| 556 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 | ||
| 557 | if (! trackingMenu) ns_check_menu_open (nil); | 548 | if (! trackingMenu) ns_check_menu_open (nil); |
| 558 | #endif | ||
| 559 | } | 549 | } |
| 560 | 550 | ||
| 561 | #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 | ||
| 562 | - (void)menuWillOpen:(NSMenu *)menu | 551 | - (void)menuWillOpen:(NSMenu *)menu |
| 563 | { | 552 | { |
| 564 | ++trackingMenu; | 553 | ++trackingMenu; |
| @@ -579,7 +568,6 @@ extern NSString *NSMenuDidBeginTrackingNotification; | |||
| 579 | { | 568 | { |
| 580 | --trackingMenu; | 569 | --trackingMenu; |
| 581 | } | 570 | } |
| 582 | #endif /* OSX >= 10.5 */ | ||
| 583 | 571 | ||
| 584 | #endif /* NS_IMPL_COCOA */ | 572 | #endif /* NS_IMPL_COCOA */ |
| 585 | 573 | ||
| @@ -608,8 +596,7 @@ extern NSString *NSMenuDidBeginTrackingNotification; | |||
| 608 | if (trackingMenu == 0) | 596 | if (trackingMenu == 0) |
| 609 | return; | 597 | return; |
| 610 | /*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */ | 598 | /*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */ |
| 611 | #if (! defined (NS_IMPL_COCOA) \ | 599 | #ifdef NS_IMPL_GNUSTEP |
| 612 | || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5) | ||
| 613 | /* Don't know how to do this for anything other than OSX >= 10.5 | 600 | /* Don't know how to do this for anything other than OSX >= 10.5 |
| 614 | This is wrong, as it might run Lisp code in the event loop. */ | 601 | This is wrong, as it might run Lisp code in the event loop. */ |
| 615 | ns_update_menubar (frame, true, self); | 602 | ns_update_menubar (frame, true, self); |
| @@ -706,9 +693,7 @@ extern NSString *NSMenuDidBeginTrackingNotification; | |||
| 706 | { | 693 | { |
| 707 | NSMenuItem *item = [self itemAtIndex: n]; | 694 | NSMenuItem *item = [self itemAtIndex: n]; |
| 708 | NSString *title = [item title]; | 695 | NSString *title = [item title]; |
| 709 | if (([title length] == 0 /* OSX 10.5 */ | 696 | if ([ns_app_name isEqualToString: title] |
| 710 | || [ns_app_name isEqualToString: title] /* from 10.6 on */ | ||
| 711 | || [@"Apple" isEqualToString: title]) /* older */ | ||
| 712 | && ![item isSeparatorItem]) | 697 | && ![item isSeparatorItem]) |
| 713 | continue; | 698 | continue; |
| 714 | [self removeItemAtIndex: n]; | 699 | [self removeItemAtIndex: n]; |