On MacOS, after closing the window, it does not reopen from the dock
See original GitHub issueIn my project, I have found that once the app is closed on MacOS, it won’t reopen from the dock. I have resolved it with the following changes in main.dev.js:
Add:
app.on('activate', () => { mainWindow.show() })
app.on('before-quit', () => app.quitting = true)
Edit:
mainWindow.on('close', (event) => {
if (app.quitting) {
mainWindow = null
} else {
event.preventDefault()
mainWindow.hide()
}
});
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Prevent apps and windows from reopening on Mac
Choose Apple menu > System Settings. Click Desktop & Dock in the sidebar. Scroll down on the right and turn on “Close windows...
Read more >On Mac OS after closing the window, it does not reopen from ...
I have developed an electron application, and after creating its build, installed it in MacBook for testing firstly the app worked fine, but...
Read more >macOS: App icon remaining in Dock even after closing app
To disable Dock from displaying recently launched app icons in the Dock, go to System Preferences app → Dock and uncheck Show recent...
Read more >macOS: Bring Off-Screen Window Back Onto Screen
If it won't focus by clicking the dock icon, quit the application, and reopen it. This will bring it into focus. 2. Click...
Read more >How to Close Apps on Your Mac - MakeUseOf
Open MacBook on a tabletop. When you get your first Mac, you might find it quite different compared to a Windows machine. The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@euangordon, your solution seems to work. Are you going to make a PR?
@AmauriAires but that was closed without merging? reason?