mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-18 07:34:54 +00:00
screenshot: Cache ScreencastSupported property
The screencast service shuts down when not in use, so it is almost certainly not running when handling the screencast shortcut. Instead of making sure the service is restarted, just cache the property when initializing the proxy. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2533>
This commit is contained in:
parent
f9ac8890d0
commit
b23de7f530
1 changed files with 4 additions and 2 deletions
|
|
@ -1017,6 +1017,7 @@ var ScreenshotUI = GObject.registerClass({
|
|||
});
|
||||
|
||||
this._screencastInProgress = false;
|
||||
this._screencastSupported = false;
|
||||
|
||||
this._screencastProxy = new ScreencastProxy(
|
||||
Gio.DBus.session,
|
||||
|
|
@ -1028,7 +1029,8 @@ var ScreenshotUI = GObject.registerClass({
|
|||
return;
|
||||
}
|
||||
|
||||
this._castButton.visible = this._screencastProxy.ScreencastSupported;
|
||||
this._screencastSupported = this._screencastProxy.ScreencastSupported;
|
||||
this._castButton.visible = this._screencastSupported;
|
||||
});
|
||||
|
||||
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
|
||||
|
|
@ -1450,7 +1452,7 @@ var ScreenshotUI = GObject.registerClass({
|
|||
if (this._screencastInProgress)
|
||||
return;
|
||||
|
||||
if (mode === UIMode.SCREENCAST && !this._screencastProxy.ScreencastSupported)
|
||||
if (mode === UIMode.SCREENCAST && !this._screencastSupported)
|
||||
return;
|
||||
|
||||
this._castButton.checked = mode === UIMode.SCREENCAST;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue