diff --git a/backend/libinput/pointer.c b/backend/libinput/pointer.c index 124a4fda3..b391b0e5d 100644 --- a/backend/libinput/pointer.c +++ b/backend/libinput/pointer.c @@ -116,6 +116,7 @@ void handle_pointer_axis(struct libinput_event *event, libinput_event_pointer_get_axis_value(pevent, axes[i]); wlr_event.delta_discrete = libinput_event_pointer_get_axis_value_discrete(pevent, axes[i]); + wlr_event.delta_discrete *= WLR_POINTER_AXIS_DISCRETE_STEP; wlr_signal_emit_safe(&pointer->events.axis, &wlr_event); } } diff --git a/backend/wayland/pointer.c b/backend/wayland/pointer.c index db31f1abb..897f7108c 100644 --- a/backend/wayland/pointer.c +++ b/backend/wayland/pointer.c @@ -184,7 +184,7 @@ static void pointer_handle_axis_discrete(void *data, return; } - pointer->axis_discrete = discrete; + pointer->axis_discrete = discrete * WLR_POINTER_AXIS_DISCRETE_STEP; } static const struct wl_pointer_listener pointer_listener = { diff --git a/include/wlr/types/wlr_pointer.h b/include/wlr/types/wlr_pointer.h index cce2a5a87..16aed1dc7 100644 --- a/include/wlr/types/wlr_pointer.h +++ b/include/wlr/types/wlr_pointer.h @@ -78,6 +78,8 @@ enum wlr_axis_orientation { WLR_AXIS_ORIENTATION_HORIZONTAL, }; +#define WLR_POINTER_AXIS_DISCRETE_STEP 120 + struct wlr_pointer_axis_event { struct wlr_pointer *pointer; uint32_t time_msec; diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c index ef058999b..d4ec38441 100644 --- a/types/seat/wlr_seat_pointer.c +++ b/types/seat/wlr_seat_pointer.c @@ -301,7 +301,7 @@ void wlr_seat_pointer_send_axis(struct wlr_seat *wlr_seat, uint32_t time, if (value_discrete && version >= WL_POINTER_AXIS_DISCRETE_SINCE_VERSION) { wl_pointer_send_axis_discrete(resource, orientation, - value_discrete); + value_discrete / WLR_POINTER_AXIS_DISCRETE_STEP); } wl_pointer_send_axis(resource, time, orientation,