diff --git a/ChangeLog b/ChangeLog index 1a469851c..0bcb90f12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-02-19 Wolfgang Lux + + * Source/NSMenu.m (-performActionForItemAtIndex:): Revert change + from r34642. The action of a pop up menu item once again is chosen + in preference to the action of the pop up button itself. This is + how it has always worked on OS X. + + * Source/NSPopUpButtonCell.m (_popUpItemAction): Fix sender of the + pop up button's action. It is now the pop up button itself and not + the pop up button cell. + 2012-02-18 Fred Kiefer * Headers/AppKit/NSGraphicsContext.h: Extend the enumerator diff --git a/Source/NSMenu.m b/Source/NSMenu.m index 004ff8779..9da26ccab 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -1310,17 +1310,18 @@ static BOOL menuBarVisible = YES; [_popUpButtonCell selectItemAtIndex: index]; } - if (_popUpButtonCell != nil && (action = [_popUpButtonCell action]) != NULL) + if ((action = [item action]) != NULL) { [NSApp sendAction: action - to: [_popUpButtonCell target] - from: [_popUpButtonCell controlView]]; + to: [item target] + from: item]; } - else if ((action = [item action]) != NULL) + else if (_popUpButtonCell != nil) { - [NSApp sendAction: action - to: [item target] - from: item]; + if ((action = [_popUpButtonCell action]) != NULL) + [NSApp sendAction: action + to: [_popUpButtonCell target] + from: [_popUpButtonCell controlView]]; } [nc postNotificationName: NSMenuDidSendActionNotification diff --git a/Source/NSPopUpButtonCell.m b/Source/NSPopUpButtonCell.m index 28466c6fb..9a0ac4626 100644 --- a/Source/NSPopUpButtonCell.m +++ b/Source/NSPopUpButtonCell.m @@ -1366,7 +1366,7 @@ static NSImage *_pbc_image[5]; [theBinding reverseSetValueFor: NSSelectedObjectBinding]; } - [NSApp sendAction: [self action] to: [self target] from: self]; + [NSApp sendAction: [self action] to: [self target] from: _control_view]; } @end