devdraw/wayland.c: prevent divide-by-zero in scroll repeat

This commit is contained in:
ylh 2024-10-27 22:32:09 -07:00 committed by Ethan Burns
parent 2b1cd9bc03
commit 1a0c0a9fdd
1 changed files with 2 additions and 1 deletions

View File

@ -448,8 +448,9 @@ static void wl_callback_done(void *data, struct wl_callback *wl_callback, uint32
wl->repeat_scroll_count--;
if (wl->repeat_scroll_count == 0) {
wl->repeat_scroll_button = 0;
} else {
wl->repeat_scroll_next_ms = time + scroll_repeat_ms/wl->repeat_scroll_count;
}
wl->repeat_scroll_next_ms = time + scroll_repeat_ms/wl->repeat_scroll_count;
}
qunlock(&wayland_lock);