Skip to content

Commit f9a8302

Browse files
committed
Merge pull request #117335 from Arthurmtro/fix/steam-tracking-macos
Fix macOS Steam time tracking lost when opening a project
2 parents 4cdc711 + 2df02c8 commit f9a8302

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

platform/macos/os_macos.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@
820820
NSWorkspaceOpenConfiguration *configuration = [[NSWorkspaceOpenConfiguration alloc] init];
821821
[configuration setArguments:arguments];
822822
[configuration setCreatesNewApplicationInstance:YES];
823+
[configuration setEnvironment:[[NSProcessInfo processInfo] environment]];
823824
__block dispatch_semaphore_t lock = dispatch_semaphore_create(0);
824825
__block Error err = ERR_TIMEOUT;
825826
__block pid_t pid = 0;
@@ -849,7 +850,11 @@
849850
} else {
850851
Error err = ERR_TIMEOUT;
851852
NSError *error = nullptr;
852-
NSRunningApplication *app = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:url options:NSWorkspaceLaunchNewInstance configuration:[NSDictionary dictionaryWithObject:arguments forKey:NSWorkspaceLaunchConfigurationArguments] error:&error];
853+
NSDictionary *config = @{
854+
NSWorkspaceLaunchConfigurationArguments : arguments,
855+
NSWorkspaceLaunchConfigurationEnvironment : [[NSProcessInfo processInfo] environment]
856+
};
857+
NSRunningApplication *app = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:url options:NSWorkspaceLaunchNewInstance configuration:config error:&error];
853858
if (error) {
854859
err = ERR_CANT_FORK;
855860
NSLog(@"Failed to execute: %@", error.localizedDescription);

0 commit comments

Comments
 (0)