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

Fix Issue #16 #18

Merged
merged 2 commits into from
Oct 8, 2019
Merged

Fix Issue #16 #18

merged 2 commits into from
Oct 8, 2019

Conversation

lesthack
Copy link
Contributor

@lesthack lesthack commented Sep 27, 2019

Fixes #16.

@FelicianoTech
Copy link
Owner

Hey @lesthack,

Looking at this PR, I'm under the impression that this will prevent multiple instances of the app from starting. That's good as that sounds like desired behavior to me.

I think part of the problem in #16 is that the app itself isn't either exiting completely or is leaving behind a tray icon when it exits. If I understand the problem correctly, then this PR doesn't completely solve the issue.

Nonetheless, I'm going to test this PR locally now.

@FelicianoTech
Copy link
Owner

Okay so I tested this PR as it stands right now and I was right. Starting Pocket Casts works correctly with the window and tray icon coming up. Closing Pocket Casts however will close the window but leave the tray icon.

Due to this PR, trying to open Pocket Casts again from the icon in the launcher doesn't work as there's still an instance running. You have to right click the tray icon and click "show".

I think the desired behavior here is when closing the window, the instance should fully quit, tray icon included.

@FelicianoTech
Copy link
Owner

I asked a question in the issue (#16) on what people think we should do. If the decision is to leave the tray icon around when the window is closed, then we should use this event (https://github.com/electron/electron/blob/master/docs/api/app.md#event-second-instance) to reopen the current instance when someone tries to start a second instance of the app.

@lesthack
Copy link
Contributor Author

@FelicianoTech,

Personally, I think the desired behavior is like the PR, I mean, when you close the window, i prefer keep listening the audio without see the application. And yes, for close completely we need go to the menu in the tray icon.

The only detail now, is when you close the window and after, open the app through the some launcher, the app don't recovery the last state and don't show.

@FelicianoTech
Copy link
Owner

when you close the window, i prefer keep listening the audio without see the application

That's what minimize is for.

@lesthack
Copy link
Contributor Author

@FelicianoTech

Yes, and not. When you minimize the app, you can see the app in your dock.

Look. In this screenshot, you can see the window app, and the icon in tray and the dock.
Screenshot from 2019-09-30 14-30-10

When I minimize the window, the icon keep in my dock:
Screenshot from 2019-09-30 14-30-24

But, when I close the window not.
Screenshot from 2019-09-30 14-30-39

So, if you want to open the app again, you can use the menu option "Show".

@FelicianoTech
Copy link
Owner

I believe that closing the main window should close the app. I think it's shady to keep running in the background afterward. I'm going to merge this PR, but then do an additional PR that closes the app when the close button is clicked.

Apps on Linux such as Slack or Zoom allow you to change a setting to determine whether to stay running in the background or not. Once #19 is completed, we can then have that same setting in this app.

@FelicianoTech FelicianoTech merged commit d1611e1 into FelicianoTech:master Oct 8, 2019
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

Successfully merging this pull request may close these issues.

Tray Icon and Multiple Instances
2 participants