Support multiple inherited ubuntu session for indicators

Multiple sessions inherits the "ubuntu" base settings properties in ubuntu.
One of the most popular one is communitheme: the next ubuntu default theme
has its dedicated session, with thus duplicated indicators for dropbox.
Rather than a string comparison for ubuntu, only match a substring then.
XDG_CURRENT_DESKTOP can be of form: "communitheme:ubuntu:GNOME",
"ubuntu:GNOME", …
Fixes: #12843.
This commit is contained in:
Didier Roche 2018-05-07 11:49:37 +02:00
parent 9c8952aef0
commit 811ae1a936

View file

@ -163,9 +163,11 @@ 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', 'ubuntu:GNOME', 'pop:GNOME'].includes(process.env.XDG_CURRENT_DESKTOP)) {
if (process.platform === 'linux') {
if (['Pantheon', 'Unity:Unity7', 'pop:GNOME'].includes(process.env.XDG_CURRENT_DESKTOP) || process.env.XDG_CURRENT_DESKTOP.includes('ubuntu')) {
process.env.XDG_CURRENT_DESKTOP = 'Unity'
}
}
// Finally load app's main.js and transfer control to C++.
Module._load(path.join(packagePath, mainStartupScript), Module, true)