From 992c9d16a3536221aac910a8acbd34b69dfc0216 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 12 Oct 2017 02:02:33 -0400 Subject: [PATCH 1/2] Upgrade to Electron 1.7.9 --- package.json | 12 ++++++++++-- yarn.lock | 14 +++++++------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 18565cf6b..052bd4b18 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,15 @@ } }, "deb": { - "depends": ["gconf2", "gconf-service", "libnotify4", "libappindicator1", "libxtst6", "libnss3", "libsecret-1-0"] + "depends": [ + "gconf2", + "gconf-service", + "libnotify4", + "libappindicator1", + "libxtst6", + "libnss3", + "libsecret-1-0" + ] }, "win": { "target": "nsis" @@ -60,7 +68,7 @@ }, "devDependencies": { "devtron": "^1.4.0", - "electron": "^1.7.5", + "electron": "^1.7.9", "electron-builder": "^11.7.0", "electron-debug": "^1.4.0" }, diff --git a/yarn.lock b/yarn.lock index 2967edcf6..40bbafce5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,8 +23,8 @@ "7zip-bin-win" "^2.1.0" "@types/node@^7.0.18": - version "7.0.32" - resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.32.tgz#6afe6c66520a4c316623a14aef123908d01b4bba" + version "7.0.43" + resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c" accessibility-developer-tools@^2.11.0: version "2.12.0" @@ -311,13 +311,13 @@ debug@2.2.0: dependencies: ms "0.7.1" -debug@2.6.0: +debug@2.6.0, debug@^2.3.2, debug@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" dependencies: ms "0.7.2" -debug@^2.1.3, debug@^2.2.0, debug@^2.3.2, debug@^2.6.0, debug@^2.6.8: +debug@^2.1.3, debug@^2.2.0, debug@^2.6.8: version "2.6.8" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" dependencies: @@ -483,9 +483,9 @@ electron-macos-sign@~1.5.0: isbinaryfile "^3.0.2" plist "^2.0.1" -electron@^1.7.5: - version "1.7.5" - resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.5.tgz#065a3102bf8b87102df50c50985fefe6c569045b" +electron@^1.7.9: + version "1.7.9" + resolved "https://registry.yarnpkg.com/electron/-/electron-1.7.9.tgz#add54e9f8f83ed02f6519ec10135f698b19336cf" dependencies: "@types/node" "^7.0.18" electron-download "^3.0.1" -- 2.45.3 From c9bd5ad48838779e9608034adb29e2a1fdac6234 Mon Sep 17 00:00:00 2001 From: Alex Liebowitz Date: Thu, 12 Oct 2017 18:04:31 -0400 Subject: [PATCH 2/2] Use Single Instance App mode on Linux This Electron feature now works on Linux again as of Electron 1.7.8. Fixes #164 (multiple windows opening on Linux when clicking lbry:// links) --- app/main.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/app/main.js b/app/main.js index 4bc9944df..e51928139 100644 --- a/app/main.js +++ b/app/main.js @@ -227,24 +227,20 @@ function quitNow() { app.quit(); } -if (process.platform != 'linux') { - // On Linux, this is always returning true due to an Electron bug, - // so for now we just don't support single-instance apps on Linux. - const isSecondaryInstance = app.makeSingleInstance((argv) => { - if (argv.length >= 2) { - handleOpenUriRequested(argv[1]); // This will handle restoring and focusing the window - } else if (win) { - if (win.isMinimized()) { - win.restore(); - } - win.focus(); +const isSecondaryInstance = app.makeSingleInstance((argv) => { + if (argv.length >= 2) { + handleOpenUriRequested(argv[1]); // This will handle restoring and focusing the window + } else if (win) { + if (win.isMinimized()) { + win.restore(); } - }); - - if (isSecondaryInstance) { // We're not in the original process, so quit - quitNow(); - return; + win.focus(); } +}); + +if (isSecondaryInstance) { // We're not in the original process, so quit + quitNow(); + return; } app.on('ready', function(){ -- 2.45.3