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

35159f
From a57132816ac7bd93d6875fee0a6c5b273177ac8d Mon Sep 17 00:00:00 2001
35159f
From: Ray Strode <rstrode@redhat.com>
35159f
Date: Wed, 30 Sep 2015 12:51:24 -0400
35159f
Subject: [PATCH 1/3] authPrompt: don't fade out auth messages if user types
35159f
 password up front
35159f
35159f
Right now we fade out any stale auth messages as soon as the user starts
35159f
typing. This behavior doesn't really make sense if the user is typing up
35159f
front, before a password is asked.
35159f
---
35159f
 js/gdm/authPrompt.js | 2 +-
35159f
 1 file changed, 1 insertion(+), 1 deletion(-)
35159f
35159f
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
35159f
index d7f53a92e..d421a8856 100644
35159f
--- a/js/gdm/authPrompt.js
35159f
+++ b/js/gdm/authPrompt.js
35159f
@@ -169,7 +169,7 @@ var AuthPrompt = class {
35159f
         this._updateNextButtonSensitivity(this._entry.text.length > 0);
35159f
 
35159f
         this._entry.clutter_text.connect('text-changed', () => {
35159f
-            if (!this._userVerifier.hasPendingMessages)
35159f
+            if (!this._userVerifier.hasPendingMessages && this._queryingService && !this._preemptiveAnswer)
35159f
                 this._fadeOutMessage();
35159f
 
35159f
             this._updateNextButtonSensitivity(this._entry.text.length > 0 || this.verificationStatus == AuthPromptStatus.VERIFYING);
35159f
-- 
35159f
2.21.0
35159f
35159f
35159f
From 50af703ea95f2b73733c38e66c9c251663a51744 Mon Sep 17 00:00:00 2001
35159f
From: Ray Strode <rstrode@redhat.com>
35159f
Date: Wed, 30 Sep 2015 14:36:33 -0400
35159f
Subject: [PATCH 2/3] authPrompt: don't spin unless answering question
35159f
35159f
---
35159f
 js/gdm/authPrompt.js | 2 +-
35159f
 1 file changed, 1 insertion(+), 1 deletion(-)
35159f
35159f
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
35159f
index d421a8856..62c5bd078 100644
35159f
--- a/js/gdm/authPrompt.js
35159f
+++ b/js/gdm/authPrompt.js
35159f
@@ -60,8 +60,8 @@ var AuthPrompt = class {
35159f
 
35159f
         this.connect('next', () => {
35159f
                 this.updateSensitivity(false);
35159f
-                this.startSpinning();
35159f
                 if (this._queryingService) {
35159f
+                    this.startSpinning();
35159f
                     this._userVerifier.answerQuery(this._queryingService, this._entry.text);
35159f
                 } else {
35159f
                     this._preemptiveAnswer = this._entry.text;
35159f
-- 
35159f
2.21.0
35159f
35159f
35159f
From b89be880936ad9dd145eb43890ac72d03c37785d Mon Sep 17 00:00:00 2001
35159f
From: Ray Strode <rstrode@redhat.com>
35159f
Date: Mon, 5 Oct 2015 15:26:18 -0400
35159f
Subject: [PATCH 3/3] authPrompt: stop accepting preemptive answer if user
35159f
 stops typing
35159f
35159f
We only want to allow the user to type the preemptive password in
35159f
one smooth motion.  If they start to type, and then stop typing,
35159f
we should discard their preemptive password as expired.
35159f
35159f
Typing ahead the password is just a convenience for users who don't
35159f
want to manually lift the shift before typing their passwords, after
35159f
all.
35159f
---
35159f
 js/gdm/authPrompt.js | 37 +++++++++++++++++++++++++++++++++++++
35159f
 1 file changed, 37 insertions(+)
35159f
35159f
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
35159f
index 62c5bd078..27eb31a89 100644
35159f
--- a/js/gdm/authPrompt.js
35159f
+++ b/js/gdm/authPrompt.js
35159f
@@ -6,6 +6,7 @@ const Signals = imports.signals;
35159f
 const Animation = imports.ui.animation;
35159f
 const Batch = imports.gdm.batch;
35159f
 const GdmUtil = imports.gdm.util;
35159f
+const Meta = imports.gi.Meta;
35159f
 const Params = imports.misc.params;
35159f
 const ShellEntry = imports.ui.shellEntry;
35159f
 const Tweener = imports.ui.tweener;
35159f
@@ -41,6 +42,8 @@ var AuthPrompt = class {
35159f
         this._gdmClient = gdmClient;
35159f
         this._mode = mode;
35159f
 
35159f
+        this._idleMonitor = Meta.IdleMonitor.get_core();
35159f
+
35159f
         let reauthenticationOnly;
35159f
         if (this._mode == AuthPromptMode.UNLOCK_ONLY)
35159f
             reauthenticationOnly = true;
35159f
@@ -65,6 +68,11 @@ var AuthPrompt = class {
35159f
                     this._userVerifier.answerQuery(this._queryingService, this._entry.text);
35159f
                 } else {
35159f
                     this._preemptiveAnswer = this._entry.text;
35159f
+
35159f
+                    if (this._preemptiveAnswerWatchId) {
35159f
+                        this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
35159f
+                        this._preemptiveAnswerWatchId = 0;
35159f
+                    }
35159f
                 }
35159f
             });
35159f
 
35159f
@@ -128,6 +136,11 @@ var AuthPrompt = class {
35159f
     }
35159f
 
35159f
     _onDestroy() {
35159f
+        if (this._preemptiveAnswerWatchId) {
35159f
+            this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
35159f
+            this._preemptiveAnswerWatchId = 0;
35159f
+        }
35159f
+
35159f
         this._userVerifier.destroy();
35159f
         this._userVerifier = null;
35159f
     }
35159f
@@ -342,6 +355,11 @@ var AuthPrompt = class {
35159f
     }
35159f
 
35159f
     setQuestion(question) {
35159f
+        if (this._preemptiveAnswerWatchId) {
35159f
+            this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
35159f
+            this._preemptiveAnswerWatchId = 0;
35159f
+        }
35159f
+
35159f
         this._label.set_text(question);
35159f
 
35159f
         this._label.show();
35159f
@@ -427,6 +445,19 @@ var AuthPrompt = class {
35159f
         }
35159f
     }
35159f
 
35159f
+    _onUserStoppedTypePreemptiveAnswer() {
35159f
+        if (!this._preemptiveAnswerWatchId ||
35159f
+            this._preemptiveAnswer ||
35159f
+            this._queryingService)
35159f
+            return;
35159f
+
35159f
+        this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
35159f
+        this._preemptiveAnswerWatchId = 0;
35159f
+
35159f
+        this._entry.text = '';
35159f
+        this.updateSensitivity(false);
35159f
+    }
35159f
+
35159f
     reset() {
35159f
         let oldStatus = this.verificationStatus;
35159f
         this.verificationStatus = AuthPromptStatus.NOT_VERIFYING;
35159f
@@ -434,6 +465,12 @@ var AuthPrompt = class {
35159f
         this.nextButton.label = _("Next");
35159f
         this._preemptiveAnswer = null;
35159f
 
35159f
+        if (this._preemptiveAnswerWatchId) {
35159f
+            this._idleMonitor.remove_watch(this._preemptiveAnswerWatchId);
35159f
+        }
35159f
+        this._preemptiveAnswerWatchId = this._idleMonitor.add_idle_watch (500,
35159f
+                                                                          this._onUserStoppedTypePreemptiveAnswer.bind(this));
35159f
+
35159f
         if (this._userVerifier)
35159f
             this._userVerifier.cancel();
35159f
 
35159f
-- 
35159f
2.21.0
35159f