Use app activate event instead of defunct activate-with-no-open-windows

This restores the ability to open a Window by single-clicking the dock
icon on macOS.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@github.com>
This commit is contained in:
Nathan Sobo
2016-09-22 15:54:44 -06:00
committed by Max Brunsfeld
parent 0b7e141921
commit f14587d3cc

View File

@@ -250,9 +250,10 @@ class AtomApplication
event.preventDefault()
@openUrl({urlToOpen, @devMode, @safeMode})
@disposable.add ipcHelpers.on app, 'activate-with-no-open-windows', (event) =>
event?.preventDefault()
@emit('application:new-window')
@disposable.add ipcHelpers.on app, 'activate', (event, hasVisibleWindows) =>
unless hasVisibleWindows
event?.preventDefault()
@emit('application:new-window')
@disposable.add ipcHelpers.on ipcMain, 'restart-application', =>
@restart()