From 806b0a086312ca12ed46bc1a634be6694e277308 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Tue, 22 Oct 2019 10:32:15 +0200 Subject: Add `liftSingleInstanceLock` to settings --- src/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/index.js b/src/index.js index 7de7a5e1c..3056a8bec 100644 --- a/src/index.js +++ b/src/index.js @@ -64,8 +64,15 @@ if (isWindows) { app.setAppUserModelId(appId); } +// Initialize Settings +const settings = new Settings('app', DEFAULT_APP_SETTINGS); +const proxySettings = new Settings('proxy'); + +// add `liftSingleInstanceLock` to settings.json to override the single instance lock +const liftSingleInstanceLock = settings.get('liftSingleInstanceLock') || false; + // Force single window -const gotTheLock = app.requestSingleInstanceLock(); +const gotTheLock = liftSingleInstanceLock ? true : app.requestSingleInstanceLock(); if (!gotTheLock) { app.quit(); } else { @@ -112,10 +119,6 @@ if (isLinux && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESK process.env.XDG_CURRENT_DESKTOP = 'Unity'; } -// Initialize Settings -const settings = new Settings('app', DEFAULT_APP_SETTINGS); -const proxySettings = new Settings('proxy'); - // Disable GPU acceleration if (!settings.get('enableGPUAcceleration')) { debug('Disable GPU Acceleration'); -- cgit v1.2.3-54-g00ecf