From 9146293b265849e4e8faee6e568614d182949f02 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: (cherry picked from commit 7b1223a2544f3da2bb147167aff9140b6f60ec97) --- 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 e6065c446..b9d5e43a7 100644 --- a/js/misc/util.js +++ b/js/misc/util.js @@ -111,8 +111,9 @@ function spawnApp(argv) { function trySpawn(argv) { var 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 {