This seems to be a larger issue than just popUpStatusItemMenu being deprecated. The issue persists even when not using popUpStatusItemMenu. For example, see the code below which fails to display the NSStatusItem's menu when, and only when, displays are arranged/stacked vertically. When the displays are arranged horizonally, there is no issue.
self.statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength: NSVariableStatusItemLength];
[self.statusItem.button sendActionOn: (NSLeftMouseUpMask|NSRightMouseUpMask)];
[self.statusItem.button setAction: @selector(statusItemClicked:)];
-(IBAction) statusItemClicked: (id) sender
{
NSEvent *currentEvent = [NSApp currentEvent];
// Right click conditions
if ((([currentEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask) ||
(([currentEvent modifierFlags] & NSCommandKeyMask) == NSCommandKeyMask) ||
(([currentEvent modifierFlags] & NSRightMouseUpMask) == NSRightMouseUpMask) ||
(([currentEvent modifierFlags] & NSRightMouseDownMask) == NSRightMouseDownMask) ||
([currentEvent type] == NSRightMouseDown) ||
([currentEvent type] == NSRightMouseUp))
{
[self showStatusMenu: self];
}
else
{
// do something besides showing the menu
}
}
-(IBAction) showStatusMenu: (id) sender
{
self.statusItem.menu = self.statusMenu;
[self.statusItem.button performClick:nil];
}
-(void) menuDidClose : (NSMenu *) someMenu
{
if (someMenu == self.statusMenu)
{
// re-configure statusitem
self.statusItem.menu = nil;
[self.statusItem.button sendActionOn: (NSLeftMouseUpMask|NSRightMouseUpMask)];
[self.statusItem.button setAction: @selector(statusItemClicked:)];
}
}