From 21cdc713bc5e9664ca6f02719217467fe2a9d17f Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Sat, 20 Nov 2021 09:13:06 -0600 Subject: [PATCH] wayland: support modifiers during axis events It was never implemented before but it's trivial. As an aside, touch events currently don't support modifiers either (is this a thing?). Well if someone complains that can be done later. Fixes #9490. --- video/out/wayland_common.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 2a3cb8a57e..413e26bbb5 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -253,19 +253,20 @@ static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer, { struct vo_wayland_state *wl = data; + int mpmod = get_mods(wl); double val = wl_fixed_to_double(value) < 0 ? -1 : 1; switch (axis) { case WL_POINTER_AXIS_VERTICAL_SCROLL: if (value > 0) - mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_DOWN, +val); + mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_DOWN | mpmod, +val); if (value < 0) - mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_UP, -val); + mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_UP | mpmod, -val); break; case WL_POINTER_AXIS_HORIZONTAL_SCROLL: if (value > 0) - mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_RIGHT, +val); + mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_RIGHT | mpmod, +val); if (value < 0) - mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_LEFT, -val); + mp_input_put_wheel(wl->vo->input_ctx, MP_WHEEL_LEFT | mpmod, -val); break; } }