diff --git a/atom-lib/finder-window.js b/atom-lib/finder-window.js index d29a73a0..2090c5d2 100644 --- a/atom-lib/finder-window.js +++ b/atom-lib/finder-window.js @@ -36,8 +36,10 @@ nodeIpc.connectTo( 'disconnect', function () { nodeIpc.log('<< disconnected from main'.notice) - appQuit = true - app.quit() + if (process.platform === 'darwin') { + appQuit = true + app.quit() + } } ) nodeIpc.of.main.on( @@ -95,9 +97,11 @@ finderWindow.on('blur', function () { }) finderWindow.on('close', function (e) { - if (appQuit) return true - e.preventDefault() - finderWindow.hide() + if (process.platform === 'darwin') { + if (appQuit) return true + e.preventDefault() + finderWindow.hide() + } }) var appIcon = new Tray(path.join(__dirname, '../resources/tray-icon.png')) diff --git a/main.js b/main.js index bedbe6da..93733f2c 100644 --- a/main.js +++ b/main.js @@ -56,7 +56,7 @@ var handleStartupEvent = function () { return false } - var squirrelCommand = process.argv[1]; + var squirrelCommand = process.argv[1] switch (squirrelCommand) { case '--squirrel-install': spawnUpdate(['--createShortcut', exeName], function (err) { @@ -228,8 +228,24 @@ app.on('ready', function () { }) var template = require('./atom-lib/menu-template') + if (process.platform === 'win32') { + template.unshift({ + label: 'Boostnote', + submenu: [ + { + label: 'Quit', + accelerator: 'Control+Q', + click: function (e) { + quitApp() + } + } + ] + }) + } var menu = Menu.buildFromTemplate(template) - Menu.setApplicationMenu(menu) + if (process.platform === 'darwin') { + Menu.setApplicationMenu(menu) + } if (process.platform === 'darwin') { setInterval(function () { @@ -268,6 +284,9 @@ app.on('ready', function () { } mainWindow = require('./atom-lib/main-window') + if (process.platform === 'win32') { + mainWindow.setMenu(menu) + } mainWindow.on('close', function (e) { if (appQuit) return true e.preventDefault()