main: Inhibit animations when there is a remote desktop session

If a remote desktop session asks for animations to be disabled, inhibit
animations while the session is active.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/757
This commit is contained in:
Jonas Ådahl 2019-10-01 12:04:52 +02:00
parent 4b42879a2c
commit 8a1c0f3a42

View File

@ -775,5 +775,31 @@ var AnimationsSettings = class {
St.Settings.get().inhibit_animations(); St.Settings.get().inhibit_animations();
return; return;
} }
let remoteAccessController = backend.get_remote_access_controller();
if (!remoteAccessController)
return;
this._handles = new Set();
remoteAccessController.connect('new-handle',
(_, handle) => this._onNewRemoteAccessHandle(handle));
}
_onRemoteAccessHandleStopped(handle) {
let settings = St.Settings.get();
settings.uninhibit_animations();
this._handles.delete(handle);
}
_onNewRemoteAccessHandle(handle) {
if (!handle.get_disable_animations())
return;
let settings = St.Settings.get();
settings.inhibit_animations();
this._handles.add(handle);
handle.connect('stopped', this._onRemoteAccessHandleStopped.bind(this));
} }
}; };