NSStatusItem's `action` method is not invoked by right-click.

Originator:peter.kamb
Number:rdar://17768873 Date Originated:7/22/2014
Status:Open Resolved:
Product:OS X Product Version:
Classification: Reproducible:Always
 
Summary:
NSStatusItems in the OS X menubar are often left clicked and right clicked.

If you provide a menu via `[statusItem setMenu:menu]` this works fine. Left and right clicks both trigger the menu.

But if you provide an action via `[statusItem setAction:@selector(action:)]`, only left clicks work. Right clicks are not detected.

There is no way to detect Right clicks on NSStatustems without resorting to more complex methods like a custom NSView.

Steps to Reproduce:
1. Create an NSStatus item in the OS X menu bar.
2. Give it a click-action via `[statusItem setAction:@selector(action:)]`
3. Run app.
4. Notice that Left Click on the item triggers the set action.
5. Notice that Right Click on the item does not trigger the action.
6. Right click sets the Highlight property of the item. It is stuck with a blue square.


Expected Results:
1. Right click triggers the Action method of the NSStatusItem
2. Left and Right clicks can be responded to with separate actions or menus.

Actual Results:
1. Left Click on the item triggers the set action.
2. Right Click on the item does not trigger the action.
3. Right click sets the Highlight property of the item. It is stuck with a blue square. Looks buggy.

Version:
OS X 10.9.4

Notes:


Configuration:


Attachments:

Comments

Engineering has provided the following information:

We believe this issue has been addressed in the latest OS X Yosemite Developer Preview. Please test with this release, and update this report with your results.

OS X Yosemite Developer Preview (Build 14A298i) Click on the 'OS X Yosemite Developer Preview' tab on this page: https://developer.apple.com/devcenter/mac/index.action

Please let us know if that resolves the issue for you by updating your bug report.

By peter.kamb at July 25, 2014, 8:33 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!