Skip to content

Commit 1b51b44

Browse files
committed
X11: Fix a regression that caused some high res scroll devices to be treated as line based scroll devices
Apparently when running under XWayland, we cant rely on libinput to detect highres scroll devices. Sigh. Linux input is such a disaster. Dunno if this will break something else, hopefully not. Fixes #9646
1 parent 39683e0 commit 1b51b44

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

docs/changelog.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ Detailed list of changes
178178

179179
- Fix kitty hanging on startup on Intel macs (:iss:`9643`)
180180

181+
- X11: Fix a regression that caused some high res scroll devices to be treated as line based scroll devices (:iss:`9649`)
182+
181183
0.46.0 [2026-03-11]
182184
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183185

glfw/x11_window.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#define _GNU_SOURCE
3131
#include "internal.h"
32+
#include "math.h"
3233
#include "backend_utils.h"
3334
#include "linux_notify.h"
3435
#include "../kitty/monotonic.h"
@@ -1446,7 +1447,7 @@ handle_xi_motion_event(_GLFWwindow *window, XIDeviceEvent *de) {
14461447
*off = delta;
14471448
if (!d->is_highres) {
14481449
if (v->increment == 120.) type = GLFW_SCROLL_OFFEST_V120;
1449-
else {
1450+
else if (fabs(delta) >= v->increment) {
14501451
type = GLFW_SCROLL_OFFSET_LINES;
14511452
if (v->increment != 0) *off /= v->increment;
14521453
}

0 commit comments

Comments
 (0)