r-c-f/waynergy

Wheel scrolling is broken with latest wlroots commit

Closed this issue · 4 comments

I have to do around 10 mouse wheel revelation to get the usual scroll response

sway version 1.8-dev-8d8a21c9c (Jul 14 2022, branch 'master')
wlroots-git 0.16.0.r5617.add44b3e2-1
17.820953923: [DEBUG] Mousewheel: x 0, y 120
[1065027.959]  -> zwlr_virtual_pointer_v1@10.axis_source(0)
[1065027.997]  -> zwlr_virtual_pointer_v1@10.axis_discrete(3446016, 0, -15.00000000, -1)
[1065028.026]  -> zwlr_virtual_pointer_v1@10.frame()
18.630223926: [DEBUG] Mousewheel: x 0, y -120
[1065837.217]  -> zwlr_virtual_pointer_v1@10.axis_source(0)
[1065837.250]  -> zwlr_virtual_pointer_v1@10.axis_discrete(3446825, 0, 15.00000000, 1)
[1065837.273]  -> zwlr_virtual_pointer_v1@10.frame()
19.061546380: [DEBUG] Got CALV

Probably something to do with wlroots commit add44b3e2 (https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/add44b3e2e4ff7ef98b16813fb3c9e1d8b398008)

Did some testing, when last argument value is increase to around 120 in
https://github.com/r-c-f/waynergy/blob/master/src/wl_input_wlr.c#L78 (and 3 other similar lines below) it seems to scroll like before..

Also from above debug dy is also 120 so it might be right to replace it with "-dy"? Like:

zwlr_virtual_pointer_v1_axis_discrete(wlr->pointer, wlTS(input->wl_ctx), 1, wl_fixed_from_int(15), -dy);

https://github.com/quoing/waynergy/tree/fix_scrolling
(this is probably breaking change for older wlroots)

r-c-f commented

Thank you for the report and the potential fix. Eventually sending the delta would probably work as the cleanest possible solution, but given that release wlroots is broken I've made it a configurable constant for the time being (defaulting to 120) in #42.

r-c-f commented

In my own tests this resolves the issue entirely with latest wlroots and sway. alacritty doesn't work, but that's broken even with a hardware mouse so likely unrelated. Feel free to reopen if issues remain.

Yup, working good. Thank you.