I’m creating a program that uses DesktopAppInfo.launch_uris_as_managers() to launch a .desktop file. But I want to receive the startup notification to change the mouse cursor from ‘progress’ to ‘default’. I tried by passing a Gio.AppLaunchContext() and connecting the ‘launched’ and ‘launch-failed’ signals, but it seems to not work always: with Thunderbird and Gimp it seems to work, but not with Gedit… (I don’t receive any of the signals).
Mmm… But I presume that another Gtk program, let’s call it program A, can’t detect the notification from another program B, even when it was that program A the one that launched program B, isn’t it? Or is it possible?
No, it’s not possible. The desktop startup id comes from the compositor (in the X11 and Wayland cases both) and the application notifies the compositor when it has complete loading the first window. The entire start up notification protocol is meant as a communication channel between an application and the desktop; other applications do not not intervene.
In the X11 case, since any client can poke at the events queue and properties of every other client, you can set up a watcher that gets a notification; on Wayland, only a privileged component can do that—notably, the display server/compositor.