Package: i3lock
Version: 2.5-1
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi!

When I suspend my laptop, I send the XF86ScreenSaver key through
ACPI. The window manager intercepts this and starts i3lock. On resume,
it seems the key bounces a bit and i3lock receives one, two or three
times the XF86ScreenSaver key. Therefore, I have to wait up to 6
seconds to really enter my password.

I propose a patch to not validate the password when it is empty. It
could be easily adapted to not validate an empty password when
XF86ScreenSaver key is pressed. Or maybe, XF86ScreenSaver key should
not be used as a validation key.

Thanks.

- -- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (101, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages i3lock depends on:
ii  libc6             2.17-92
ii  libcairo2         1.12.14-5+clipfix
ii  libev4            1:4.11-1
ii  libpam0g          1.1.3-9
ii  libx11-6          2:1.6.1-1
ii  libx11-xcb1       2:1.6.1-1
ii  libxcb-dpms0      1.9.1-3
ii  libxcb-image0     0.3.9-1
ii  libxcb-shm0       1.9.1-3
ii  libxcb-util0      0.3.8-2
ii  libxcb-xinerama0  1.9.1-3
ii  libxcb1           1.9.1-3
ii  libxkbcommon0     0.3.1-1
ii  libxkbfile1       1:1.0.8-1

i3lock recommends no packages.

i3lock suggests no packages.

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)

iQIcBAEBCAAGBQJSF/ydAAoJEJWkL+g1NSX5cB0P/22l9QrmQfZwj6EoKGHjtLAi
lq8+2xWJclL2OevbsQLoKPkAryWNbD/PTfwtT889T735lH/iet+gNWJYoOveiV1C
nos6AC2s4RP91bRo6rZTm6CvI/SHeMnP3uFnY9sTd6nZEWRw3I1yHS6GxuF67iN+
VPwAqUTC5i97/vrZB5O/5tO2PKiRn5Q8kxeDxojSpSaZBOK15TrnGHsegCH2L3fu
95fqJ2Sbe6Db0nLhuMOM2gN8Kev/hqpI0k8KKMHZ4tbCkOr+Ke05lrhrTNySHyTs
pXsmq24m/bDE0Esh7jpTzBFNajf9UIS1bc1qFRTkpvXrQ/Sv30yb48Ooj60WHSfe
b/++peNR8OIJqohhzMaPNZhLFgH53UCk33fvfnka5LpnOhOnQGfoQGV6NLhaC0bz
D0fa0XGLLXfBzs90xxZ06GtslP+6lG9lRHzmLEjGHfiqkkV5wCKz58d8RHgXuRlw
w5AjFgnS+1lBRPRcLEWHZUFqLi62cA2hunbXDXrS3X67J4oIGCVEIEaKGLS9H0fD
lIt2Eu5UoJnp5SoRr4e0aTl7znH/wltjnuQpWrcBBfqSGZr3k6UDLhKy/jKYPlh5
QZBOoAKh6Dba6MZ5qirFVP526yo4Wi8ijmEmbOowEkVvVMVuiMR9ZVvSk921DhGy
ZgxEBA/aqDZ6jWD8zM1G
=7h+j
-----END PGP SIGNATURE-----
Description: Do not validate empty passwords
Author: Vincent Bernat <[email protected]>

--- i3lock-2.5.orig/i3lock.c
+++ i3lock-2.5/i3lock.c
@@ -267,6 +267,10 @@ static void handle_key_press(xcb_key_pre
     case XKB_KEY_Return:
     case XKB_KEY_KP_Enter:
     case XKB_KEY_XF86ScreenSaver:
+        if (input_position == 0) {
+            clear_input();
+            return;
+        }
         password[input_position] = '\0';
         unlock_state = STATE_KEY_PRESSED;
         redraw_screen();

Reply via email to