main: init app menu on ready event to fix macOs menus & shortcuts -> 0.24.2

This commit is contained in:
jean-emmanuel 2018-02-18 01:35:35 +01:00
parent ce247b4098
commit aeef06749d
5 changed files with 19 additions and 18 deletions

View file

@ -1,5 +1,10 @@
# Changelog
## 0.24.2
- bug fixes
- macOs app menu & shortcuts
## 0.24.1
- bug fixes

View file

@ -13,12 +13,6 @@ if (settings.read('noGpu') || (!settings.cli && settings.read('argv')['disable-
app.disableHardwareAcceleration()
}
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit()
}
})
var template = [{
label: 'Edit',
submenu: [
@ -60,8 +54,6 @@ if (process.platform === 'darwin') {
}
]
})
// Add Window menu (OS X)
template.push(
{
label: 'Window',
@ -101,9 +93,19 @@ if (process.platform === 'darwin') {
)
}
app.on('before-quit',()=>{
process.exit()
})
var menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
app.on('ready',()=>{
var menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
})
app.on('window-all-closed', function() {
if (process.platform !== 'darwin') {
app.quit()
}
})
module.exports = app

View file

@ -37,16 +37,10 @@ var start = function(readyApp) {
address += settings.read('urlOptions')
if (app.isReady()) {
var win = require('./electron-window')({address:address, shortcuts:true})
app.on('before-quit',()=>{
process.exit()
})
return win
} else {
app.on('ready',function(){
var win = require('./electron-window')({address:address, shortcuts:true})
app.on('before-quit',()=>{
process.exit()
})
})
}
}

View file

@ -2,7 +2,7 @@
"name": "open-stage-control",
"productName": "Open Stage Control",
"description": "Libre and modular OSC / MIDI controller",
"version": "0.24.1",
"version": "0.24.2",
"author": {
"name": "Jean-Emmanuel Doucet / AMMD",
"email": "jeannot@ammd.net"

View file

@ -1,7 +1,7 @@
{
"name": "open-stage-control-builder",
"description": "[Builder package] Libre and modular OSC / MIDI controller",
"version": "0.24.1",
"version": "0.24.2",
"author": {
"name": "Jean-Emmanuel Doucet / AMMD",
"email": "jeannot@ammd.net"