Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

showDockIcon: false not working on macOS #306

Open
jamiebullock opened this issue Nov 20, 2020 · 7 comments
Open

showDockIcon: false not working on macOS #306

jamiebullock opened this issue Nov 20, 2020 · 7 comments

Comments

@jamiebullock
Copy link

Description

On macOS the dock icon is initially hidden, but when I click the menubar app, it appears, and the native app menu bar is also shown.

Steps to Reproduce the Problem

  1. Launch one of the examples that comes with menubar, e.g. hello-world
  2. Observe that no dock icon is visible
  3. Click the menubar icon

Expected Behaviour

No dock icon appears when the menubar icon is clicked

Actual Behaviour

A dock icon appears, along with a set of main app menus (Electron, File, View, Window, Help)

Specifications

  • Menubar version: 9.0.1
  • Platform: macOS 10.15 and 11.0.1
  • Electron version: v9.3.4

Other information

@jamiebullock
Copy link
Author

OK, I can "fix" this if I put app.dock.hide(); in the after-create-window event handler. However, I think that if showDockIcon is false this shouldn't be necessary

@Zmaon
Copy link

Zmaon commented Nov 24, 2020

Same here. Just got this issue after upgrading Electron and Menubar. Seems related to #296

@sirbrillig
Copy link

Also just noticed this. It worked before, but now it's not hiding the icon. Interestingly, I also tried setting LSUIElement in the Info.plist file (there seems to be conflicting information on how to set this, but I tried <real>1</real>, <string>1</string>, <string>YES</string>, and <true/> with the same result) and it doesn't seem to have any effect. Explicitly calling app.dock.hide did work; thank you for that!

@KYDronePilot
Copy link

The other solutions mentioned did not work consistently for me, so I ended up downgrading to Electron ~9.2.0. This temporarily fixes the issue.

@jamiebullock
Copy link
Author

OK, an update...

The app.dock.hide() solution mentioned above seems to work on macOS 10.15 and 11.0.1. It does not work on macOS 11.1

However, for me setting LSUIElement to true does work on 11.1, so I now have both solutions in my app.

In case anyone is unsure, to add custom items to the Info.plist, they can added in the "Mac" key of the package.json like so:

"mac": {
      "extendInfo":{
        "LSUIElement": "true"
      },

@maxmandia
Copy link

any update on this?

@maxmandia
Copy link

must use showOnAllWorkspaces: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants