Add OS X dock menu with 'New Window' option

This commit is contained in:
Douwe Maan
2015-11-13 10:51:31 +01:00
parent 05550699bd
commit 288abbc57b

View File

@@ -82,6 +82,7 @@ class AtomApplication
@listenForArgumentsFromNewProcess()
@setupJavaScriptArguments()
@handleEvents()
@setupDockMenu()
@storageFolder = new StorageFolder(process.env.ATOM_HOME)
if options.pathsToOpen?.length > 0 or options.urlsToOpen?.length > 0 or options.test
@@ -280,6 +281,13 @@ class AtomApplication
ipc.on 'write-to-stderr', (event, output) ->
process.stderr.write(output)
setupDockMenu: ->
if process.platform is 'darwin'
dockMenu = Menu.buildFromTemplate [
{label: 'New Window', click: => @emit('application:new-window')}
]
app.dock.setMenu dockMenu
# Public: Executes the given command.
#
# If it isn't handled globally, delegate to the currently focused window.