From 2c36652be2d8ea6b68a3bb82f11fe96208444f0e Mon Sep 17 00:00:00 2001 From: apricotbucket28 <71973804+apricotbucket28@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:25:10 -0300 Subject: [PATCH] wayland: fix handling of non-discrete scroll events (#9548) https://github.com/zed-industries/zed/pull/9103 broke touchpad scrolling on Wayland This PR correctly filters the `Axis` to handle all non-discrete scroll events (see https://wayland.app/protocols/wayland#wl_pointer:enum:axis_source) Should fix https://github.com/zed-industries/zed/issues/9525 Release Notes: - N/A --- crates/gpui/src/platform/linux/wayland/client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/platform/linux/wayland/client.rs b/crates/gpui/src/platform/linux/wayland/client.rs index 7bb3ebb0f8..c2a470a48d 100644 --- a/crates/gpui/src/platform/linux/wayland/client.rs +++ b/crates/gpui/src/platform/linux/wayland/client.rs @@ -966,8 +966,9 @@ impl Dispatch for WaylandClientState { value, .. } => { + // We handle discrete scroll events with `AxisValue120`. if wl_pointer.version() >= wl_pointer::EVT_AXIS_VALUE120_SINCE - && state.axis_source != AxisSource::Continuous + && state.axis_source == AxisSource::Wheel { return; }