screenshot: Also handle dbus service crashes

When the screencast dbus service crashes due to gstreamer, we should also
handle that and not pretend to continue recording.

Let's listen to g-name-owner changes for that and then also send a
notification about it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2752>
This commit is contained in:
Jonas Dreßler 2023-04-26 13:27:38 +02:00
parent 99923ac612
commit fd730a4db7

View File

@ -1040,6 +1040,16 @@ var ScreenshotUI = GObject.registerClass({
this._screencastProxy.connectSignal('Error', this._screencastProxy.connectSignal('Error',
() => this._screencastFailed()); () => this._screencastFailed());
this._screencastProxy.connect('notify::g-name-owner', () => {
if (this._screencastProxy.g_name_owner)
return;
if (!this._screencastInProgress)
return;
this._screencastFailed();
});
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
// The full-screen screenshot has a separate container so that we can // The full-screen screenshot has a separate container so that we can