[gnome-shell] main: Inhibit animations when there is a remote desktop session



commit 8a1c0f3a4212f581fd90aab9d11f05d5fba9e0e1
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue Oct 1 12:04:52 2019 +0200

    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

 js/ui/main.js | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index 65cbbd3ac8..05b30d5449 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -775,5 +775,31 @@ var AnimationsSettings = class {
             St.Settings.get().inhibit_animations();
             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));
     }
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]