Only set application menu on OS X.

This commit is contained in:
Cheng Zhao 2013-08-06 21:08:30 +08:00
parent 296feb1a50
commit 286335c8f9
2 changed files with 4 additions and 2 deletions

View file

@ -156,9 +156,12 @@ app.on('finish-launching', function() {
]; ];
menu = Menu.buildFromTemplate(template); menu = Menu.buildFromTemplate(template);
if (process.platform == 'darwin')
Menu.setApplicationMenu(menu); Menu.setApplicationMenu(menu);
ipc.on('message', function(processId, routingId, type) { ipc.on('message', function(processId, routingId, type) {
console.log(type);
if (type == 'menu') if (type == 'menu')
menu.popup(mainWindow); menu.popup(mainWindow);
}); });

View file

@ -7,7 +7,6 @@
This is the default mode of Atom Shell, please follow the instructions in This is the default mode of Atom Shell, please follow the instructions in
wiki to get started. wiki to get started.
<script type="text/javascript" charset="utf-8"> <script type="text/javascript" charset="utf-8">
var ipc = require('ipc'); var ipc = require('ipc');
window.addEventListener('contextmenu', function (e) { window.addEventListener('contextmenu', function (e) {