diff --git a/docs/changelog.rst b/docs/changelog.rst index 561ef2581..c56842352 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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`) diff --git a/kitty/mouse.c b/kitty/mouse.c index 7ddaacdf6..9f07c61eb 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -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;