openconnect-gui icon indicating copy to clipboard operation
openconnect-gui copied to clipboard

Act as a menu bar application on macOS

Open jakepetroules opened this issue 8 years ago • 5 comments

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.

jakepetroules avatar Jul 18 '17 21:07 jakepetroules

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.

horar avatar Jul 31 '17 09:07 horar

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.

jakepetroules avatar Jul 31 '17 18:07 jakepetroules

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.

horar avatar Aug 06 '17 18:08 horar

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.

jakepetroules avatar Aug 06 '17 18:08 jakepetroules

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.

horar avatar Aug 08 '17 16:08 horar