mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-16 21:45:03 +02:00
Initial implementation of momentum for finger based scrolling on Wayland
Needs configuration and possibly the parameter adjustment once pixel scrolling is merged.
This commit is contained in:
13
glfw/wl_init.c
vendored
13
glfw/wl_init.c
vendored
@@ -221,15 +221,14 @@ pointer_handle_frame(void *data UNUSED, struct wl_pointer *pointer UNUSED) {
|
||||
ev.offset_type = GLFW_SCROLL_OFFEST_HIGHRES;
|
||||
ev.x_offset = info.continuous.x;
|
||||
}
|
||||
float scale = (float)_glfwWaylandWindowScale(window);
|
||||
ev.x_offset *= scale; ev.y_offset *= scale;
|
||||
ev.x_offset *= -1;
|
||||
glfw_handle_scroll_event_for_momentum(
|
||||
window, &ev, MAX(info.y_start_time, info.x_start_time), info.y_stop_received || info.x_stop_received,
|
||||
info.source_type == WL_POINTER_AXIS_SOURCE_FINGER);
|
||||
/* clear pointer_curr_axis_info for next frame */
|
||||
memset(&info, 0, sizeof(info));
|
||||
|
||||
if (ev.y_offset != 0.0f || ev.x_offset != 0.0f) {
|
||||
float scale = (float)_glfwWaylandWindowScale(window);
|
||||
ev.x_offset *= scale; ev.y_offset *= scale;
|
||||
ev.x_offset *= -1;
|
||||
_glfwInputScroll(window, &ev);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user