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

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