Merge pull request #1 from ylh/wayland-fdiv

devdraw/wayland.c: prevent divide-by-zero in scroll repeat
This commit is contained in:
Ethan Burns 2024-10-28 05:31:56 -04:00 committed by GitHub
commit a3cbe3483f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -448,8 +448,9 @@ static void wl_callback_done(void *data, struct wl_callback *wl_callback, uint32
wl->repeat_scroll_count--; wl->repeat_scroll_count--;
if (wl->repeat_scroll_count == 0) { if (wl->repeat_scroll_count == 0) {
wl->repeat_scroll_button = 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); qunlock(&wayland_lock);