cli: add switch to toggle gui's vertical synchronization

This commit is contained in:
jean-emmanuel 2016-12-09 17:52:09 +01:00
parent 5b2a237a35
commit 7fdfb18c28
3 changed files with 9 additions and 3 deletions

View file

@ -1,12 +1,12 @@
var shortcut = require('electron-localshortcut'),
{app, dialog} = require('electron')
dialog.showErrorBox = function(title,err) {
console.log(title + ': ' + err)
}
app.commandLine.appendSwitch('--enable-touch-events')
app.commandLine.appendSwitch('--disable-gpu-vsync')
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {

View file

@ -26,6 +26,10 @@ var start = function(readyApp) {
var app = require('./electron-app')
var address = typeof settings.read('guiOnly')=='string'? 'http://' + settings.read('guiOnly') : settings.read('appAddresses')[0]
if (settings.read('noVsync')) {
app.commandLine.appendSwitch('--disable-gpu-vsync')
}
if (app.isReady()) {
return require('./electron-window')({address:address, shortcuts:true})
} else {

View file

@ -48,7 +48,8 @@ var options = {
return (!e || !argv.l) ?
true : 'examples can\'t be listed if --load is set'
}
}
},
'disable-vsync':{type:'boolean',describe:'disable gui\'s vertical synchronization'}
}
@ -92,6 +93,7 @@ var makeDefaultConfig = function(argv){
customModule: argv.c || false,
noGui: argv.n || false,
guiOnly: typeof argv.g == 'string' ? argv.g.length ? argv.g : true : false,
noVsync: argv['disable-vsync'] || false,
appAddresses:function(){
var appAddresses = []