macOS: Fix scrolling very slowly with wheel mice not working

Fixes #1238
This commit is contained in:
Kovid Goyal 2018-12-18 11:15:22 +05:30
parent c9441bd3e2
commit 703a1b83a8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,8 @@ Changelog
- macOS: Add an entry to the dock menu to open a new OS window (:iss:`1242`)
- macOS: Fix scrolling very slowly with wheel mice not working (:iss:`1238`)
- Fix changing :opt:`cursor_text_color` via remote control not working
(:iss:`1229`)

View File

@ -585,6 +585,9 @@ scroll_event(double UNUSED xoffset, double yoffset, int flags) {
global_state.callback_os_window->pending_scroll_pixels = pixels - s * (int) global_state.callback_os_window->fonts_data->cell_height;
} else {
s = (int) round(yoffset * OPT(wheel_scroll_multiplier));
// apparently on cocoa some mice generate really small yoffset values
// when scrolling slowly https://github.com/kovidgoyal/kitty/issues/1238
if (s == 0 && yoffset != 0) s = yoffset > 0 ? 1 : -1;
global_state.callback_os_window->pending_scroll_pixels = 0;
}
if (s == 0) return;