From 7b1223a2544f3da2bb147167aff9140b6f60ec97 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 26 Oct 2023 16:03:44 +0200 Subject: [PATCH] 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: --- js/misc/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/misc/util.js b/js/misc/util.js index 0201fd112..de5e6d861 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -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 {