[gnome-shell] screenShield: Compute lock timeout fade duration using animation settings



commit ab6a629955d8bd3c004ec0eb21f57987f48ac655
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Fri Oct 4 11:04:43 2019 +0200

    screenShield: Compute lock timeout fade duration using animation settings
    
    When the screen is marked as idle, we normally start a fading animation and
    a timeout to finally lock the screen. This timeout is configured using the
    fade time if no longer delay is set in settings.
    
    However if animations are disabled or slowed-down/up, the fade time is
    different from the STANDARD_FADE_TIME and so we might end up showing the
    lock shield without actually locking for STANDARD_FADE_TIME in the disabled
    or slowed-up animations case, or locking too early in case of slowed-down
    animations.
    
    So, just adjust the timeout time using the same logic of animations so that
    this value is matching all the times.
    
    Related to https://gitlab.gnome.org/GNOME/gnome-shell/issues/1744
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/749

 js/ui/screenShield.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index 576df48f62..b1f6f24101 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -17,6 +17,8 @@ const MessageTray = imports.ui.messageTray;
 const ShellDBus = imports.ui.shellDBus;
 const SmartcardManager = imports.misc.smartcardManager;
 
+const { adjustAnimationTime } = imports.ui.environment;
+
 const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
 const LOCK_ENABLED_KEY = 'lock-enabled';
 const LOCK_DELAY_KEY = 'lock-delay';
@@ -832,7 +834,7 @@ var ScreenShield = class {
 
         if (shouldLock) {
             let lockTimeout = Math.max(
-                STANDARD_FADE_TIME,
+                adjustAnimationTime(STANDARD_FADE_TIME),
                 this._settings.get_uint(LOCK_DELAY_KEY) * 1000);
             this._lockTimeoutId = GLib.timeout_add(
                 GLib.PRIORITY_DEFAULT,


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