4
votes

This is yet one more of those "how to switch from running with a dock icon to running without one" questions with a twist.. I don't want the dock icon but I do want a menu bar when the application is at the front. Is that possible?

Running an application with LSUIElement set to 1 in the plist will launch the application without a dock icon, not showing up in the command-tab switch list and without a menu.

You can switch from that mode to the "normal" mode with all three switched on via SetSystemModeUI from 10.2 onwards and via NSApplication setApplicationActivationPolicy since 10.6, but crucially there is no way back to the previous mode (go figure).

So one way around this would be to launch with LSUIElement = 1 and then activate the menu bar when the application gets the focus and deactivate it on the application losing the focus.. alas I can't find a way of doing that.

Can anybody help?

Best regards,

Frank

2

2 Answers

2
votes

I too was looking for a solution, but it turned out to be quite simple: In the project file Info.plist need to add the key

"Application is agent (UIElement)" = YES

0
votes

Unfortunately, this is not possible. You can only transform the process type in one direction (from a background app to a foreground app) and not the other way.