added a workaround for tray issue in ubuntu

This commit is contained in:
antelle 2017-06-05 14:30:22 +02:00
parent b7475a8d4c
commit ac00b77fc4
1 changed files with 8 additions and 0 deletions

View File

@ -23,6 +23,7 @@ if (!htmlPath) {
}
app.setPath('userData', path.join(tempUserDataPath, tempUserDataPathRand));
setEnv();
app.on('window-all-closed', () => {
if (restartPending) {
@ -356,6 +357,13 @@ function subscribePowerEvents() {
});
}
function setEnv() {
if (process.platform === 'linux' && ['Pantheon', 'Unity:Unity7'].indexOf(process.env.XDG_CURRENT_DESKTOP) !== -1) {
// https://github.com/electron/electron/issues/9046
process.env.XDG_CURRENT_DESKTOP = 'Unity';
}
}
function deleteOldTempFiles() {
setTimeout(() => {
for (const dir of fs.readdirSync(tempUserDataPath)) {