NSApp(ignoringOtherApps:) is deprecated but there is no other working alternative for menu bar apps.
NSApp.activate() does not work when no app windows are active and we want to show a window from a menu bar application. Making it impossible for the app to open a window and make it active.
Is it really an intended behavior?
Here is a sample project showing the issue: https://github.com/wojciech-kulik/macos-menu-bar-bug
Steps to reproduce:
- Run the app.
- Focus some other app like Finder or Safari.
- Click on the app's menu bar icon and select "Open".
The app window will appear below the other app's window, instead of being brought to the front.
NSApp(ignoringOtherApps: true) works as expected though.
I also created a feedback ticket: FB23508310