--- slock.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/slock.c b/slock.c index df2d3c6..2a65f54 100644 --- a/slock.c +++ b/slock.c _AT_@ -136,12 +136,15 @@ readpw(Display *dpy, const char *pws) len = 0; running = True; + /* slurp lingering key release events */ + do XNextEvent(dpy, &ev); while (ev.type == KeyRelease); + /* As "slock" stands for "Simple X display locker", the DPMS settings * had been removed and you can set it with "xset" or some other * utility. This way the user can easily set a customized DPMS * timeout. */ while (running && !XNextEvent(dpy, &ev)) { - if (ev.type == KeyPress) { + if (ev.type == KeyRelease) { buf[0] = 0; num = XLookupString(&ev.xkey, buf, sizeof(buf), &ksym, 0); if (IsKeypadKey(ksym)) { -- 2.7.0
This archive was generated by hypermail 2.3.0 : Thu Jan 28 2016 - 07:24:14 CET