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

Should the dock icon open the app? #278

Closed
RobbieTheWagner opened this issue Apr 24, 2020 · 4 comments · Fixed by #279
Closed

Should the dock icon open the app? #278

RobbieTheWagner opened this issue Apr 24, 2020 · 4 comments · Fixed by #279

Comments

@RobbieTheWagner
Copy link
Contributor

We have the showDockIcon option, but it seems clicking the dock icon does not show the app. Should it should the app or is the icon solely to show it is running? I would love to be able to open the app from the dock icon and have the window show.

@amaury1093
Copy link
Collaborator

True, right now it only shows the dock icon. If someone makes a PR for this, I can merge it

@RobbieTheWagner
Copy link
Contributor Author

@amaurymartiny would something like this work?

mb.app.on('activate', (event, hasVisibleWindows) => {
  if (!hasVisibleWindows) {
    mb.showWindow();
  } else {
    mb.hideWindow();
  }
});

I added that in my app and it seems to work okay so far.

@amaury1093
Copy link
Collaborator

On macos, I just tried 5-6 apps, if you click on the dock icon when the app is already opened, it doesn't hide it. So I would remove the hideWindow part

@RobbieTheWagner
Copy link
Contributor Author

@amaurymartiny PR is up, hope I did it right! #279

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

Successfully merging a pull request may close this issue.

2 participants