Info about mod keys such as Caps Lock is now displayed
during typing, not only on failed attempt.
Signed-off-by: Janczar Kurek <janczar.kurek@student.uj.edu.pl>
Before this change, i3lock could become unusable on systems where pixmap
allocations take long.
I don’t know precisely why, but slow pixmap allocations is a symptom that my
computer sometimes exhibits, apparently when low on GPU memory.
In that situation, duplicate key press events would be processed (apparently
received from X11!), making correct password entry impossible.
On gcc-10 (and gcc-9 -fno-common) build fails as:
```
CCLD i3lock
ld: i3lock-unlock_indicator.o:i3lock/unlock_indicator.c:38:
multiple definition of `input_position'; i3lock-i3lock.o:i3lock/i3lock.c:69: first defined here
ld: i3lock-unlock_indicator.o:(.bss+0x102): multiple definition of `__odr_asan.input_position'; i3lock-i3lock.o:(.bss+0x92b): first defined here
```
gcc-10 will change the default from -fcommon to fno-common:
https://gcc.gnu.org/PR85678.
The error also happens if CFLAGS=-fno-common passed explicitly.
Reported-by: Hans de Graaff
Bug: https://bugs.gentoo.org/706286
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
This adds some feedback to a keypress which previously had no visible effect.
While the text “no input” isn’t the most descriptive, it was the only one I
could think of which fit into the unlock indicator circle. If you have a better
suggestion, let me know.
fixes#164
Display "locking…" message when grabbing the pointer/keyboard,
after at least 250 ms of unfruitful attempts. If grabbing
eventually fails, application will not fork and return 1.
When the unlock indicator warns the user that a password was typed
wrong, it now also reports the state of the capslock and numlock
modifiers.
Signed-off-by: Alexandre Boeglin <alex@boeglin.org>
Thanks to Ran Benita and Daniel Stone (the libxkbcommon authors) for
answering my questions and reviewing this code.
With this commit, input handling should be more correct with using less
code (in i3lock, that is).
See also:
http://article.gmane.org/gmane.linux.kernel/1268792
The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.