Issue with 'Launching executable...' Window Behavior on Linux

Hello,

I’m experiencing an issue on Linux when launching an application from ShotGrid Desktop. The ‘Launching executable…’ window only appears after I exit the launched application, rather than when the software is initially launched.

Here are the last logs before the app is launched:

[1650397 DEBUG sgtk.env.project.tk-gaffer] Waiting for menu to be created…
[1650397 DEBUG sgtk.env.project.tk-gaffer] Applying Qt5-specific styling…
At this point, the process seems to hang, but once I quit the application, the following log appears multiple times:

Waiting for menu to be created…
It seems like the logs and ‘Launching executable…’ window are delayed until after the app is closed.

Is there a way to fix this behavior so that the window appears at the correct time, or to disable the ‘Launching Software…’ window altogether? We use a custom window for this purpose, so we would prefer to disable it if possible.

shotgrid desktop app: v1.8.0
Rocky Linux 8.10

Thanks in advance!

Bene

Quick update: It seems that the delay is happening with the ‘hook tried to launch…’ log (tk-desktop log). On both Linux and Windows, this log only appears after I quit the application.

I’ve managed to find the solution:
We used this:

cmd = [app_path] + app_args.split() # linux
cmd = f'"{app_path}" {app_args}' # windows
exit_code = subprocess.check_call(cmd)

and this blocked the execution of subsequent code until the app was closed.

Correct usage:

cmd = "%s %s &" % (app_path, app_args)  # linux
cmd = 'start /B "App" "%s" %s' % (app_path, app_args) # windows 
exit_code = os.system(cmd)

found here: https://github.com/shotgunsoftware/tk-multi-launchapp/blob/master/hooks/app_launch.py