misc: Fetch environment from launch context before spawn_async()

This will fetch the right environment for the launched application,
without using GNOME Shell's environment.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2993>
This commit is contained in:
Carlos Garnacho 2023-10-26 16:03:44 +02:00 committed by Marge Bot
parent 9153876764
commit 7b1223a254

View File

@ -120,8 +120,9 @@ export function spawnApp(argv) {
export function trySpawn(argv) {
let success_, pid;
try {
const launchContext = global.create_app_launch_context(0, -1);
[success_, pid] = GLib.spawn_async(
null, argv, null,
null, argv, launchContext.get_environment(),
GLib.SpawnFlags.SEARCH_PATH | GLib.SpawnFlags.DO_NOT_REAP_CHILD,
() => {
try {