main: add --disable-gpu switch (pr #133 / issue #132)

This commit is contained in:
jean-emmanuel 2018-01-20 00:00:41 +01:00
parent 8d54f54869
commit 32488e7ff5
4 changed files with 7 additions and 1 deletions

View file

@ -9,6 +9,9 @@ if (settings.read('noVsync') || (!settings.cli && settings.read('argv')['disabl
app.commandLine.appendSwitch('--disable-gpu-vsync')
}
if (settings.read('noGpu') || (!settings.cli && settings.read('argv')['disable-gpu'])) {
app.disableHardwareAcceleration()
}
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {

View file

@ -68,7 +68,7 @@ if (settings.cli) {
launcher
app.on('ready',function(){
launcher = require('./electron-window')({address:address, shortcuts:false, width:680, height:597, color:'#283143'})
launcher = require('./electron-window')({address:address, shortcuts:false, width:680, height:626, color:'#283143'})
})
process.stdout.write = (function(write) {

View file

@ -63,6 +63,7 @@ var options = {
}
},
'disable-vsync':{type:'boolean',describe:'disable gui\'s vertical synchronization', restart: true},
'disable-gpu':{type:'boolean',describe:'disable hardware acceleration', restart: true},
'read-only':{type:'boolean',describe:'disable session editing and session history changes',
check: (r, argv)=>{
return (!r || !argv.b) ?
@ -138,6 +139,7 @@ var makeDefaultConfig = function(argv){
guiOnly: typeof argv.g == 'string' ? argv.g.length ? argv.g : true : false,
urlOptions: argv['url-options'] ? '?' + argv['url-options'].join('&') : '',
noVsync: argv['disable-vsync'] || false,
noGpu: argv['disable-gpu'] || false,
readOnly: argv['read-only'] || false,
midi: argv.m,
appAddresses:function(){

View file

@ -24,6 +24,7 @@ Below are the available command-line options. Note that when running without any
| -e, --examples | list examples instead of recent sessions |
| --url-options | [url options](extras/url-options) (opt=value pairs) |
| --disable-vsync | disable gui's vertical synchronization |
| --disable-gpu | disable hardware acceleration |
| --read-only | disable session editing and session history changes |
| --instance-name | used to differenciate multiple instances in a zeroconf network |