diff --git a/docs/changelog.rst b/docs/changelog.rst index bf0dfad8b..191aa50e3 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -178,6 +178,8 @@ Detailed list of changes - Fix kitty hanging on startup on Intel macs (:iss:`9643`) +- X11: Fix a regression that caused some high res scroll devices to be treated as line based scroll devices (:iss:`9649`) + 0.46.0 [2026-03-11] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/glfw/x11_window.c b/glfw/x11_window.c index 31d44f44e..539ced065 100644 --- a/glfw/x11_window.c +++ b/glfw/x11_window.c @@ -29,6 +29,7 @@ #define _GNU_SOURCE #include "internal.h" +#include "math.h" #include "backend_utils.h" #include "linux_notify.h" #include "../kitty/monotonic.h" @@ -1446,7 +1447,7 @@ handle_xi_motion_event(_GLFWwindow *window, XIDeviceEvent *de) { *off = delta; if (!d->is_highres) { if (v->increment == 120.) type = GLFW_SCROLL_OFFEST_V120; - else { + else if (fabs(delta) >= fabs(v->increment)) { type = GLFW_SCROLL_OFFSET_LINES; if (v->increment != 0) *off /= v->increment; }