File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1447,9 +1447,16 @@ handle_xi_motion_event(_GLFWwindow *window, XIDeviceEvent *de) {
14471447 * off = delta ;
14481448 if (!d -> is_highres ) {
14491449 if (v -> increment == 120. ) type = GLFW_SCROLL_OFFEST_V120 ;
1450- else if (fabs (delta ) >= fabs (v -> increment )) {
1451- type = GLFW_SCROLL_OFFSET_LINES ;
1452- if (v -> increment != 0 ) * off /= v -> increment ;
1450+ else {
1451+ // XInput2 has no reliable way to distinguish high res scroll devices so we
1452+ // assume that if fractional values are seen it must be high res. Sigh, Linux, the
1453+ // land of truly wondrous wonders. See https://github.com/kovidgoyal/kitty/issues/9649
1454+ double int_part ; bool delta_is_fractional = modf (delta , & int_part ) != 0. ;
1455+ if (delta_is_fractional ) d -> is_highres = true;
1456+ else {
1457+ type = GLFW_SCROLL_OFFSET_LINES ;
1458+ if (v -> increment != 0 ) * off /= v -> increment ;
1459+ }
14531460 }
14541461 }
14551462 }
You can’t perform that action at this time.
0 commit comments