question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

On MacOS, after closing the window, it does not reopen from the dock

See original GitHub issue

In 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:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
extern-ccommented, Dec 28, 2018

@euangordon, your solution seems to work. Are you going to make a PR?

0reactions
adamchenweicommented, Aug 28, 2019

@AmauriAires but that was closed without merging? reason?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found