Act as a menu bar application on macOS
Although OpenConnect behaves as a menu bar application on macOS, it still shows an icon in the Dock. This is undesired.
To properly mark the app as a menu bar app, add the LSUIElement key with a bool value of YES, to the Info.plist.
I don't treat this app as menu bar only application.
You are right about the icon in dock - it's redundant. But enabling this flag we will lose menubar with settings etc.
But enabling this flag we will lose menubar with settings etc.
No you won't. I have LSUIElement=YES in my copy and it shows in the menubar with the settings menu etc. just fine. You can also still click restore and get the main window back.
With enabled flag, you can reach only systray icon popup menu. But You don't see about and these settings etc. and you can switch between oc-gui and other app windows (e.g. we can shot log window) - the only way to show main & logging windows is to raise them with some new action menu item in pop-up systray menu.
Or, I do something wrong? Thanks.
Well, as a menu bar app, the "Restore" menu item from the menu bar icon works just fine to show the main window with the main / VPN info tabs.
It's true that About and Settings would need duplicated menu items in the system tray menu, and this is the recommended and typical approach for these types of apps on macOS.
You could also make the menu bar status configurable by using the -[NSApplication setActivationPolicy:] method.
Indeed, I don't like the 'agent' mode of this application. Interaction with present main window, settings and log window will be much worse. Moreover, the present design need much more design changes to look good in agent and application modes. May be later, after 1.6 release.