Blame SOURCES/disable-unlock-entry-until-question.patch

12ec7d
From f941682d22a0e6f40e1109df8043291398783ff4 Mon Sep 17 00:00:00 2001
12ec7d
From: Ray Strode <rstrode@redhat.com>
12ec7d
Date: Wed, 30 Sep 2015 12:51:24 -0400
12ec7d
Subject: [PATCH 1/3] authPrompt: don't fade out auth messages if user types
12ec7d
 password up front
12ec7d
12ec7d
Right now we fade out any stale auth messages as soon as the user starts
12ec7d
typing. This behavior doesn't really make sense if the user is typing up
12ec7d
front, before a password is asked.
12ec7d
---
12ec7d
 js/gdm/authPrompt.js | 2 +-
12ec7d
 1 file changed, 1 insertion(+), 1 deletion(-)
12ec7d
12ec7d
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
12ec7d
index a436431be..dedf39f99 100644
12ec7d
--- a/js/gdm/authPrompt.js
12ec7d
+++ b/js/gdm/authPrompt.js
12ec7d
@@ -185,7 +185,7 @@ var AuthPrompt = new Lang.Class({
12ec7d
 
12ec7d
         this._entry.clutter_text.connect('text-changed',
12ec7d
                                          Lang.bind(this, function() {
12ec7d
-                                             if (!this._userVerifier.hasPendingMessages)
12ec7d
+                                             if (!this._userVerifier.hasPendingMessages && this._queryingService && !this._preemptiveAnswer)
12ec7d
                                                  this._fadeOutMessage();
12ec7d
 
12ec7d
                                              this._updateNextButtonSensitivity(this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING);
12ec7d
-- 
12ec7d
2.14.2
12ec7d
12ec7d
12ec7d
From 7b83ebcdc1d667438de5a0f41cb7b194b2792d1f Mon Sep 17 00:00:00 2001
12ec7d
From: Ray Strode <rstrode@redhat.com>
12ec7d
Date: Wed, 30 Sep 2015 14:36:33 -0400
12ec7d
Subject: [PATCH 2/3] authPrompt: don't spin unless answering question
12ec7d
12ec7d
---
12ec7d
 js/gdm/authPrompt.js | 2 +-
12ec7d
 1 file changed, 1 insertion(+), 1 deletion(-)
12ec7d
12ec7d
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
12ec7d
index dedf39f99..b3ff91789 100644
12ec7d
--- a/js/gdm/authPrompt.js
12ec7d
+++ b/js/gdm/authPrompt.js
12ec7d
@@ -66,8 +66,8 @@ var AuthPrompt = new Lang.Class({
12ec7d
 
12ec7d
         this.connect('next', Lang.bind(this, function() {
12ec7d
                          this.updateSensitivity(false);
12ec7d
-                         this.startSpinning();
12ec7d
                          if (this._queryingService) {
12ec7d
+                             this.startSpinning();
12ec7d
                              this._userVerifier.answerQuery(this._queryingService, this._entry.text);
12ec7d
                          } else {
12ec7d
                              this._preemptiveAnswer = this._entry.text;
12ec7d
-- 
12ec7d
2.14.2
12ec7d
12ec7d
12ec7d
From 76e455916f6411c695f4528bffbb49c5832ec568 Mon Sep 17 00:00:00 2001
12ec7d
From: Ray Strode <rstrode@redhat.com>
12ec7d
Date: Mon, 5 Oct 2015 15:26:18 -0400
12ec7d
Subject: [PATCH 3/3] authPrompt: stop accepting preemptive answer if user
12ec7d
 stops typing
12ec7d
12ec7d
We only want to allow the user to type the preemptive password in
12ec7d
one smooth motion.  If they start to type, and then stop typing,
12ec7d
we should discard their preemptive password as expired.
12ec7d
12ec7d
Typing ahead the password is just a convenience for users who don't
12ec7d
want to manually lift the shift before typing their passwords, after
12ec7d
all.
12ec7d
---
12ec7d
 js/gdm/authPrompt.js | 38 ++++++++++++++++++++++++++++++++++++++
12ec7d
 1 file changed, 38 insertions(+)
12ec7d
12ec7d
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
12ec7d
index b3ff91789..9affbdd5f 100644
12ec7d
--- a/js/gdm/authPrompt.js
12ec7d
+++ b/js/gdm/authPrompt.js
12ec7d
@@ -10,6 +10,7 @@ const St = imports.gi.St;
12ec7d
 const Animation = imports.ui.animation;
12ec7d
 const Batch = imports.gdm.batch;
12ec7d
 const GdmUtil = imports.gdm.util;
12ec7d
+const Meta = imports.gi.Meta;
12ec7d
 const Params = imports.misc.params;
12ec7d
 const ShellEntry = imports.ui.shellEntry;
12ec7d
 const Tweener = imports.ui.tweener;
12ec7d
@@ -47,6 +48,8 @@ var AuthPrompt = new Lang.Class({
12ec7d
         this._gdmClient = gdmClient;
12ec7d
         this._mode = mode;
12ec7d
 
12ec7d
+        this._idleMonitor = Meta.IdleMonitor.get_core();
12ec7d
+
12ec7d
         let reauthenticationOnly;
12ec7d
         if (this._mode == AuthPromptMode.UNLOCK_ONLY)
12ec7d
             reauthenticationOnly = true;
12ec7d
@@ -71,6 +74,11 @@ var AuthPrompt = new Lang.Class({
12ec7d
                              this._userVerifier.answerQuery(this._queryingService, this._entry.text);
12ec7d
                          } else {
12ec7d
                              this._preemptiveAnswer = this._entry.text;
12ec7d
+
12ec7d
+                             if (this._preemptiveAnswerWatchId) {
12ec7d
+                                 this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
12ec7d
+                                 this._preemptiveAnswerWatchId = 0;
12ec7d
+                             }
12ec7d
                          }
12ec7d
                      }));
12ec7d
 
12ec7d
@@ -137,6 +145,11 @@ var AuthPrompt = new Lang.Class({
12ec7d
     },
12ec7d
 
12ec7d
     _onDestroy: function() {
12ec7d
+        if (this._preemptiveAnswerWatchId) {
12ec7d
+            this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
12ec7d
+            this._preemptiveAnswerWatchId = 0;
12ec7d
+        }
12ec7d
+
12ec7d
         this._userVerifier.destroy();
12ec7d
         this._userVerifier = null;
12ec7d
     },
12ec7d
@@ -358,6 +371,11 @@ var AuthPrompt = new Lang.Class({
12ec7d
     },
12ec7d
 
12ec7d
     setQuestion: function(question) {
12ec7d
+        if (this._preemptiveAnswerWatchId) {
12ec7d
+            this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
12ec7d
+            this._preemptiveAnswerWatchId = 0;
12ec7d
+        }
12ec7d
+
12ec7d
         this._label.set_text(question);
12ec7d
 
12ec7d
         this._label.show();
12ec7d
@@ -443,12 +461,32 @@ var AuthPrompt = new Lang.Class({
12ec7d
         }
12ec7d
     },
12ec7d
 
12ec7d
+    _onUserStoppedTypePreemptiveAnswer: function() {
12ec7d
+        if (!this._preemptiveAnswerWatchId ||
12ec7d
+            this._preemptiveAnswer ||
12ec7d
+            this._queryingService)
12ec7d
+            return;
12ec7d
+
12ec7d
+        this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
12ec7d
+        this._preemptiveAnswerWatchId = 0;
12ec7d
+
12ec7d
+        this._entry.text = '';
12ec7d
+        this.updateSensitivity(false);
12ec7d
+    },
12ec7d
+
12ec7d
     reset: function() {
12ec7d
         let oldStatus = this.verificationStatus;
12ec7d
         this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
12ec7d
         this.cancelButton.reactive = true;
12ec7d
         this.nextButton.label = _("Next");
12ec7d
 
12ec7d
+        if (this._preemptiveAnswerWatchId) {
12ec7d
+            this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
12ec7d
+        }
12ec7d
+        this._preemptiveAnswerWatchId = this._idleMonitor.add_idle_watch (500,
12ec7d
+                                                                          Lang.bind(this,
12ec7d
+                                                                                    this._onUserStoppedTypePreemptiveAnswer));
12ec7d
+
12ec7d
         if (this._userVerifier)
12ec7d
             this._userVerifier.cancel();
12ec7d
 
12ec7d
-- 
12ec7d
2.14.2
12ec7d