From 254dcdaa458b449d0e8e2e0c6dc0f991527761cc Mon Sep 17 00:00:00 2001 From: Matthias Niess Date: Fri, 9 Jun 2017 15:22:18 +0200 Subject: [PATCH 1/2] add tray icon workaround for newer Ubuntu releases (fixes #9046) --- lib/browser/init.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/browser/init.js b/lib/browser/init.js index 5e4fbf28199..bcd7851e6ff 100644 --- a/lib/browser/init.js +++ b/lib/browser/init.js @@ -162,8 +162,8 @@ require('./api/protocol') // Set main startup script of the app. const mainStartupScript = packageJson.main || 'index.js' -// Workaround for electron/electron#5050 -if (process.platform === 'linux' && process.env.XDG_CURRENT_DESKTOP === 'Pantheon') { +// Workaround for electron/electron#5050 and electron/electron#9046 +if (process.platform === 'linux' && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESKTOP) !== -1) { process.env.XDG_CURRENT_DESKTOP = 'Unity' } From 43271c162a1634d51c293f716851dc6332f9eda1 Mon Sep 17 00:00:00 2001 From: Vanessa Yuen Date: Fri, 9 Jun 2017 14:45:47 -0700 Subject: [PATCH 2/2] use `includes` instead of `indexOf` --- lib/browser/init.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/browser/init.js b/lib/browser/init.js index bcd7851e6ff..8153cb904a2 100644 --- a/lib/browser/init.js +++ b/lib/browser/init.js @@ -163,7 +163,7 @@ require('./api/protocol') const mainStartupScript = packageJson.main || 'index.js' // Workaround for electron/electron#5050 and electron/electron#9046 -if (process.platform === 'linux' && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESKTOP) !== -1) { +if (process.platform === 'linux' && ['Pantheon', 'Unity:Unity7'].includes(process.env.XDG_CURRENT_DESKTOP)) { process.env.XDG_CURRENT_DESKTOP = 'Unity' }