Notification about startup of non-D-Bus-activatable app

This is related to Cancel the startup notification on "launch-failed" signal.

I’m using g_app_info_launch () and connect to AppLaunchContext ::launched and AppLaunchContext ::launch-failed.

I noticed that when I launch an app that is not D-Bus-activatable but has StartupNotify=true and StartupWMClass=$window_name set in it’s desktop entry, the launched signal is sent immediately when the app’s process is started, even if the process doesn’t do anything but exit(1). GNOME Shell however seems to know that the app is still starting and displays a spinning cursor until the window is shown. Is there any way for me to also get the information when the window of an app is displayed (and ideally also if the app’s process exits without displaying it’s window)?

The app uses GTK and the windowing system is Wayland.

This is the difference between the signal being emitted when spawn happens, and the session management D-Bus messages being sent between the app and gnome-session as the main window is shown. iirc that’s what gnome-shell listens to.

Not sure what information you want to receive?