[gnome-shell] gdm: don't show fingerprint message right away



commit 8529ca70af24b5b3863cbef52193cfe3d4f70c3f
Author: Ray Strode <rstrode redhat com>
Date:   Tue Oct 11 13:12:18 2011 -0400

    gdm: don't show fingerprint message right away
    
    Right now we show "(or swipe finger)" at the user login prompt
    any time we detect a fingerprint reader.
    
    Checking for the presense of a fingerprint reader isn't really
    sufficient for knowing if it is appropriate or not to show the
    message, though. Often, a user's fingerprint won't be enrolled
    in the system even if the machine has a fingerprint reader.
    
    In this scenario, we end up in a situation where the code will
    fade out the message right after fading it in, or worse, fade
    out the message while fading it in.
    
    The former case looks flickery and bad, and the latter case
    causes the login dialog to lock up since it never completes its
    "show prompt" animation and we don't procede with the login
    process until after that animation.
    
    If a user is enrolled in the system, the fingerprint pam module
    tries to tell the user to swipe their finger.  We never show the
    user that message because it's redundant with our own "(or swipe
    finger)" message and because it uses techy words like "UPEK" and
    "TouchStrip".
    
    This commit changes the code to defer showing "(or swipe
    finger)" until the fingerprint pam module forwards us its own
    message. This makes it less likely we'll show the message when
    fingerprint login won't work, and also removes the fingerprint
    animation from the critical path "show prompt" animation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=660492

 js/gdm/loginDialog.js |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 4a8a9e6..3db76de 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -922,6 +922,7 @@ LoginDialog.prototype = {
 
                      function() {
                          this._sessionList.close();
+                         this._promptFingerprintMessage.hide();
                          this._userList.actor.show();
                          this._userList.actor.opacity = 255;
                          return this._userList.showItems();
@@ -943,7 +944,18 @@ LoginDialog.prototype = {
     },
 
     _onInfo: function(client, serviceName, info) {
-        // we don't want fingerprint messages with the word UPEK in them
+        // We don't display fingerprint messages, because they
+        // have words like UPEK in them. Instead we use the messages
+        // as a cue to display our own message.
+        if (serviceName == _FINGERPRINT_SERVICE_NAME &&
+            this._haveFingerprintReader &&
+            (!this._promptFingerprintMessage.visible ||
+             this._promptFingerprintMessage.opacity != 255)) {
+
+            _fadeInActor(this._promptFingerprintMessage);
+            return;
+        }
+
         if (serviceName != _PASSWORD_SERVICE_NAME)
             return;
         Main.notifyError(info);
@@ -971,10 +983,10 @@ LoginDialog.prototype = {
                      },
 
                      function() {
-                         if (!this._haveFingerprintReader)
-                             return null;
-
-                         return _fadeInActor(this._promptFingerprintMessage);
+                         // Show it with 0 opacity so we preallocate space for it
+                         // in the event we need to fade in the message
+                         this._promptFingerprintMessage.opacity = 0;
+                         this._promptFingerprintMessage.show();
                      },
 
                      function() {



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