From af6ff15ee227951475fa97e598d9e489334f6d69 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 2 Jun 2018 13:25:33 +0530 Subject: [PATCH] Wayland: Fix wheel/touchpad scrolling in opposite direction Workaround for glfw bug. Fixes #594 --- kitty/mouse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kitty/mouse.c b/kitty/mouse.c index 1d636b811..6eb5b0204 100644 --- a/kitty/mouse.c +++ b/kitty/mouse.c @@ -416,6 +416,9 @@ mouse_event(int button, int modifiers) { void scroll_event(double UNUSED xoffset, double yoffset) { + // glfw inverts the y-axis when reporting scroll events under wayland + // Until this is fixed in upstream, invert y ourselves. + if (global_state.is_wayland) yoffset *= -1; int s = (int) round(yoffset * OPT(wheel_scroll_multiplier)); if (s == 0) return; bool upwards = s > 0;