No Closed signal is sent when user stops screencast.
I have an application which uses the org.freedesktop.portal.Screencast interface to start a screencast. This works OK. I can start and stop the screencast from my dialog.
However, when the user stops the screencast from the tray menu (gnome shell, I suppose), my application does not receive a 'Closed' signal which it should receive as per the documentation
After some debugging of DBUS signals, I think the cause is in xdg-desktop-portal-gnome:
In the following output of dbus-monitor, sender :1.76 is xdg-desktop-portal-gnome:
signal time=1670408104.424914 sender=:1.27 -> destination=(null destination) serial=1602 path=/org/gnome/Mutter/ScreenCast/Session/u2; interface=org.gnome.Mutter.ScreenCast.Session; member=Closed
method call time=1670408104.425461 sender=:1.76 -> destination=:1.27 serial=163 path=/org/gnome/Mutter/ScreenCast/Session/u2; interface=org.gnome.Mutter.ScreenCast.Session; member=Stop
error time=1670408104.425847 sender=:1.27 -> destination=:1.76 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=163
string "Object does not exist at path “/org/gnome/Mutter/ScreenCast/Session/u2”"
You can see that Mutter sends a Closed signal, and the xdg-desktop-portal-gnome reacts by trying to Stop the screencast. but the mutter object is already gone.
My guess is that the error prevents xdg-desktop-portal-gnome from sending the 'Closed' signal to the DBUS so my (and other apps) can catch it.