[hackers] [slock][patch] Prevent shift key from toggling to failed state

From: Michael Spradling <mike_AT_mspradling.com>
Date: Mon, 27 Aug 2018 14:16:38 -0400

Currently if the first character pressed is the shift key, slock moves
to the failed state. The failed state can modify the display and
provide incorrect feedback to the user and also gives away that your
first character required the shift key.
---
 slock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/slock.c b/slock.c
index 5ae738c..e9dd1ad 100644
--- a/slock.c
+++ b/slock.c
_AT_@ -154,7 +154,9 @@ readpw(Display *dpy, struct xrandr *rr, struct lock **locks, int nscreens,
 			    IsKeypadKey(ksym) ||
 			    IsMiscFunctionKey(ksym) ||
 			    IsPFKey(ksym) ||
-			    IsPrivateKeypadKey(ksym))
+			    IsPrivateKeypadKey(ksym) ||
+			    ksym == XK_Shift_L ||
+			    ksym == XK_Shift_R)
 				continue;
 			switch (ksym) {
 			case XK_Return:
-- 
2.18.0
Received on Mon Aug 27 2018 - 20:16:38 CEST

This archive was generated by hypermail 2.3.0 : Mon Aug 27 2018 - 20:24:21 CEST