Specifically, it behaves inconsistently regarding text field focus.
I have an LSUIElement popping up a status menu. Within that menu there is a view containing a text field. The text field needs to be selectable -- not necessarily selected by default, but whichever.
When the status item is clicked, it triggers
[NSApp activateIgnoringOtherApps:YES];
And it works, about half the time.* The other half the status menu seems to consider itself "in the background" and won t let me put focus on the text field even by clicking on it. (I know the status item click-trigger is firing b/c there s an NSLog on it.)
Is this a bug in the way Apple handles these status items, or am I mishandling activateIgnoringOtherApps?
*In fact, it seems to fail only the first time after another app is activated. After that it works fine.
The complete snippet:
-(void)statusItemClicked:(id)sender {
//show the popup menu associated with the status item.
[statusItem popUpStatusItemMenu:statusMenu];
//activate *after* showing the popup menu to obtain focus for the text field.
[NSApp activateIgnoringOtherApps:YES];
}