Scale touchpad input by display scale on wayland

This commit is contained in:
Rui Ming (Max) Xiong 2022-02-13 20:47:02 -05:00
parent 4b4f904aac
commit d2288d8f83

4
glfw/wl_init.c vendored
View File

@ -336,14 +336,14 @@ static void pointerHandleAxis(void* data UNUSED,
window->wl.axis_discrete_count.x--; window->wl.axis_discrete_count.x--;
return; return;
} }
x = -wl_fixed_to_double(value); x = -wl_fixed_to_double(value) * (window->wl.scale);
} }
else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) { else if (axis == WL_POINTER_AXIS_VERTICAL_SCROLL) {
if (window->wl.axis_discrete_count.y) { if (window->wl.axis_discrete_count.y) {
window->wl.axis_discrete_count.y--; window->wl.axis_discrete_count.y--;
return; return;
} }
y = -wl_fixed_to_double(value); y = -wl_fixed_to_double(value) * (window->wl.scale);
} }
_glfwInputScroll(window, x, y, 1, _glfw.wl.xkb.states.modifiers); _glfwInputScroll(window, x, y, 1, _glfw.wl.xkb.states.modifiers);