fix: leave behind the unmodified XDG_CURRENT_DESKTOP variable (#23512)

This commit is contained in:
Samuel Attard 2020-05-12 20:13:53 -07:00 коммит произвёл GitHub
Родитель dcbed18f44
Коммит 54ff423dac
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 12 добавлений и 0 удалений

Просмотреть файл

@ -147,3 +147,14 @@ the one downloaded by `npm install`. Usage:
```sh ```sh
export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing export ELECTRON_OVERRIDE_DIST_PATH=/Users/username/projects/electron/out/Testing
``` ```
## Set By Electron
Electron sets some variables in your environment at runtime.
### `ORIGINAL_XDG_CURRENT_DESKTOP`
This variable is set to the value of `XDG_CURRENT_DESKTOP` that your application
originally launched with. Electron sometimes modifies the value of `XDG_CURRENT_DESKTOP`
to affect other logic within Chromium so if you want access to the _original_ value
you should look up this environment variable instead.

Просмотреть файл

@ -186,6 +186,7 @@ function currentPlatformSupportsAppIndicator () {
} }
// Workaround for electron/electron#5050 and electron/electron#9046 // Workaround for electron/electron#5050 and electron/electron#9046
process.env.ORIGINAL_XDG_CURRENT_DESKTOP = process.env.XDG_CURRENT_DESKTOP;
if (currentPlatformSupportsAppIndicator()) { if (currentPlatformSupportsAppIndicator()) {
process.env.XDG_CURRENT_DESKTOP = 'Unity'; process.env.XDG_CURRENT_DESKTOP = 'Unity';
} }