aboutsummaryrefslogtreecommitdiffstats
path: root/src/nsmenu.m
diff options
context:
space:
mode:
authorJan Djärv2013-08-11 17:34:26 +0200
committerJan Djärv2013-08-11 17:34:26 +0200
commitf90e3ebd13de8169ada56274f3abaa1ea8dc6d05 (patch)
treed7967ba697c4bc6cd608f1451e3ab0a44050ff75 /src/nsmenu.m
parent423d3b3f9acf6b4d9f9a0b8a22a20809896117e4 (diff)
downloademacs-f90e3ebd13de8169ada56274f3abaa1ea8dc6d05.tar.gz
emacs-f90e3ebd13de8169ada56274f3abaa1ea8dc6d05.zip
Fix crash on OSX >= 10.7.
* nsmenu.m (ns_update_menubar): Call fillWithWidgetValue:frame: (initWithTitle:): Initialize frame to 0. (fillWithWidgetValue:): Call fillWithWidgetValue:frame. (fillWithWidgetValue:frame:): Renamed from fillWithWidgetValue:setDelegate, call initWithTile:frame: if f. * nsterm.h (EmacsMenu): fillWithWidgetValue:setDelegate renamed to fillWithWidgetValue:frame:
Diffstat (limited to 'src/nsmenu.m')
-rw-r--r--src/nsmenu.m17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index 1ae2a34ab92..2850f0ed97d 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -366,7 +366,7 @@ ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu)
366 } 366 }
367 else 367 else
368 { 368 {
369 [menu fillWithWidgetValue: first_wv->contents setDelegate:YES]; 369 [menu fillWithWidgetValue: first_wv->contents frame: f];
370 } 370 }
371 371
372 } 372 }
@@ -527,6 +527,7 @@ x_activate_menubar (struct frame *f)
527/* override designated initializer */ 527/* override designated initializer */
528- initWithTitle: (NSString *)title 528- initWithTitle: (NSString *)title
529{ 529{
530 frame = 0;
530 if ((self = [super initWithTitle: title])) 531 if ((self = [super initWithTitle: title]))
531 [self setAutoenablesItems: NO]; 532 [self setAutoenablesItems: NO];
532 return self; 533 return self;
@@ -725,10 +726,10 @@ extern NSString *NSMenuDidBeginTrackingNotification;
725 726
726- (void)fillWithWidgetValue: (void *)wvptr 727- (void)fillWithWidgetValue: (void *)wvptr
727{ 728{
728 [self fillWithWidgetValue: wvptr setDelegate:NO]; 729 [self fillWithWidgetValue: wvptr frame:nil];
729} 730}
730 731
731- (void)fillWithWidgetValue: (void *)wvptr setDelegate: (BOOL)set 732- (void)fillWithWidgetValue: (void *)wvptr frame: (struct frame *)f
732{ 733{
733 widget_value *wv = (widget_value *)wvptr; 734 widget_value *wv = (widget_value *)wvptr;
734 735
@@ -743,11 +744,13 @@ extern NSString *NSMenuDidBeginTrackingNotification;
743 744
744 if (wv->contents) 745 if (wv->contents)
745 { 746 {
746 EmacsMenu *submenu = [[EmacsMenu alloc] initWithTitle: [item title]]; 747 EmacsMenu *submenu;
748
749 if (f)
750 submenu = [[EmacsMenu alloc] initWithTitle: [item title] frame:f];
751 else
752 submenu = [[EmacsMenu alloc] initWithTitle: [item title]];
747 753
748#ifdef NS_IMPL_COCOA
749 if (set) [submenu setDelegate: submenu];
750#endif
751 [self setSubmenu: submenu forItem: item]; 754 [self setSubmenu: submenu forItem: item];
752 [submenu fillWithWidgetValue: wv->contents]; 755 [submenu fillWithWidgetValue: wv->contents];
753 [submenu release]; 756 [submenu release];