From 9ef0a508a75158d0b9a14f9d1271cd67124d4ac7 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 20 Jan 2018 00:00:41 +0100 Subject: [PATCH] main: add --disable-gpu switch (pr #133 / issue #132) --- app/main/electron-app.js | 3 +++ app/main/main.js | 2 +- app/main/settings.js | 2 ++ resources/docs/getting-started.md | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/main/electron-app.js b/app/main/electron-app.js index 5486fa82..40f3cd74 100644 --- a/app/main/electron-app.js +++ b/app/main/electron-app.js @@ -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') { diff --git a/app/main/main.js b/app/main/main.js index 38cdf548..6d29a8a4 100644 --- a/app/main/main.js +++ b/app/main/main.js @@ -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) { diff --git a/app/main/settings.js b/app/main/settings.js index c929fb32..da08c2ce 100644 --- a/app/main/settings.js +++ b/app/main/settings.js @@ -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(){ diff --git a/resources/docs/getting-started.md b/resources/docs/getting-started.md index d94c7dcf..d37a0408 100644 --- a/resources/docs/getting-started.md +++ b/resources/docs/getting-started.md @@ -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 |