diff --git a/docs/changelog.rst b/docs/changelog.rst index fce395184..fa08cbc4e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -269,6 +269,10 @@ Detailed list of changes - Wayland: Fix the window class (app_id) and title being lost when an OS window is hidden and then shown again (:iss:`10602`) +- Linux: Fix momentum scrolling not coasting when scrolling up or left, until + the first scroll down or right (:pull:`10610`) + + 0.49.2 [2026-10-01] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/momentum-scroll.c b/glfw/momentum-scroll.c index bcbabf09a..5b6a5d25c 100644 --- a/glfw/momentum-scroll.c +++ b/glfw/momentum-scroll.c @@ -221,8 +221,8 @@ handle_scroll_event(_GLFWwindow *w, const GLFWScrollEvent *ev, bool stopped, boo memset(&s.physical_event, 0, sizeof(s.physical_event)); s.physical_event.start = now; } - if (ev->unscaled.y > 0) s.scale = ev->y_offset / ev->unscaled.y; - else if (ev->unscaled.x > 0) s.scale = ev->x_offset / ev->unscaled.x; + if (ev->unscaled.y != 0) s.scale = ev->y_offset / ev->unscaled.y; + else if (ev->unscaled.x != 0) s.scale = ev->x_offset / ev->unscaled.x; if (s.window_id && s.window_id != w->id) cancel_existing_scroll(true); if (s.state != PHYSICAL_EVENT_IN_PROGRESS) cancel_existing_scroll(false); if (!is_synthetic_momentum_start_event) {