[gnome-shell] ScreenShield: emit lock-status-changed at the end of animation for manual locking too



commit 7ad881d0ec9d7a4a4cdec44ce43809c80a76113f
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Jan 29 15:49:18 2013 +0100

    ScreenShield: emit lock-status-changed at the end of animation for manual locking too
    
    gnome-settings-daemon uses lock-status-changed/ActiveChanged to drive
    screen blanking, so must wait for the animation end before emitting it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691964

 js/ui/screenShield.js |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index af8269f..9043bc3 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -951,6 +951,12 @@ const ScreenShield = new Lang.Class({
         this._lockScreenGroup.fixed_position_set = false;
         this._lockScreenScrollCounter = 0;
 
+        let prevIsActive = this._isActive;
+        this._isActive = true;
+
+        if (prevIsActive != this._isActive)
+            this.emit('lock-status-changed');
+
         this.emit('lock-screen-shown');
     },
 
@@ -1078,8 +1084,16 @@ const ScreenShield = new Lang.Class({
 
         this._resetLockScreen(animate, animate);
 
-        this._isActive = true;
-        this.emit('lock-status-changed');
+        // We used to set isActive and emit lock-status-changed here,
+        // but now we do that from lockScreenShown, which means
+        // there is a 0.3 seconds window during which the lock
+        // screen is effectively visible and the screen is locked, but
+        // the DBus interface reports the screensaver is off.
+        // This is because when we emit ActiveChanged(true),
+        // gnome-settings-daemon blanks the screen, and we don't want
+        // blank during the animation.
+        // This is not a problem for the idle fade case, because we
+        // activate without animation in that case.
     },
 
     lock: function(animate) {



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