Merge branch 'dont-crash-when-keyboard-repeat-rate-is-zero'

This commit is contained in:
Daniel Eklöf 2021-01-16 15:24:02 +01:00
commit 0142930702
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 4 additions and 0 deletions

View file

@ -80,6 +80,7 @@
(https://codeberg.org/dnkl/foot/issues/291).
* Sixel “current geometry” query response not being bounded by the
current window dimensions (fixes `lsix` output)
* Crash on keyboard input when repeat rate was zero (i.e. no repeat).
### Security

View file

@ -580,6 +580,9 @@ start_repeater(struct seat *seat, uint32_t key)
if (seat->kbd.repeat.dont_re_repeat)
return true;
if (seat->kbd.repeat.rate == 0)
return true;
struct itimerspec t = {
.it_value = {.tv_sec = 0, .tv_nsec = seat->kbd.repeat.delay * 1000000},
.it_interval = {.tv_sec = 0, .tv_nsec = 1000000000 / seat->kbd.repeat.rate},