diff options
author | Dudemanguy <random342@airmail.cc> | 2021-11-20 09:13:06 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2021-11-20 09:17:41 -0600 |
commit | 21cdc713bc5e9664ca6f02719217467fe2a9d17f (patch) | |
tree | 67fbd54c32c7f31edbb929066f87a53b56957ba5 | |
parent | 59898331dd9c3f68275907f6b5fe798c44d93d8c (diff) | |
download | mpv-21cdc713bc5e9664ca6f02719217467fe2a9d17f.tar.bz2 mpv-21cdc713bc5e9664ca6f02719217467fe2a9d17f.tar.xz |
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.
-rw-r--r-- | video/out/wayland_common.c | 9 |
1 files 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; } } |