swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.46k stars 1.1k forks source link

Middle button scrolling not working (TrackPoint) #6541

Open tejohnso opened 3 years ago

tejohnso commented 3 years ago
Xyene commented 3 years ago

I believe this should be addressed by the in-progress https://github.com/swaywm/wlroots/pull/3082. I'm a little surprised the non-hi-res versions of the events are not sent, but I'm not very familiar with the matter.

chmanie commented 2 years ago

I have noticed that, too, but for me at least it seems to be exclusively the case for Chromium (-based browsers). It works fine in all other windows.

JoseExposito commented 2 years ago

Just see this issue as a mention in the high-resolution PR.

I'm a little surprised the non-hi-res versions of the events are not sent, but I'm not very familiar with the matter.

The kernel should be sending both low-resolution and high-resolution events. When the kernel doesn't support high-resolution (Linux < 5) libinput does the emulation. You are right, both events should be sent.

@tejohnso could you attach the output of sudo libinput record, please? You can redirect it to a file: sudo libinput record > record.txt.

The command will ask you to select your device number. Once selected, reproduce the issue by pressing the middle click button and moving the trackpoint. Then press Control+C to exit.

That'd help me to discard (or not) an issue in libinput and to the wlroots devs to replay it locally using libinput replay <file>.

I'd be helpful to know if it happens globally or, as @chmanie mentioned, only in Chromium.

tokyovigilante commented 2 years ago

I'm pretty sure this is a Chromium-only issue and specific to the Ozone cross-platform layer. I see this as well when running Vivaldi (Chrome 94) with --enable-features=UseOzonePlatform --ozone-platform=wayland. If I omit this flag (so that Chrome falls back to Xwayland) trackpad scroll works fine.

This was a fairly recent bug (~2 months) as I've been running with Ozone for a year or so and it has previously worked, I'm just not sure if it's Sway or more likely Chromium given it depends on the backend, and from my attempts to debug locally, the trackpoint axis events are generated fine.

record.txt

For reference, wev output during trackpoint scroll:

[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947790; axis: 0 (vertical), value: 5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947799; axis: 0 (vertical), value: 5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947810; axis: 0 (vertical), value: 4.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947820; axis: 0 (vertical), value: 4.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947830; axis: 0 (vertical), value: 5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947840; axis: 0 (vertical), value: 7.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947850; axis: 0 (vertical), value: 5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947861; axis: 0 (vertical), value: 2.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947881; axis: 0 (vertical), value: 1.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947911; axis: 0 (vertical), value: 1.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947922; axis: 0 (vertical), value: -1.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 947993; axis: 0 (vertical), value: -3.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948013; axis: 0 (vertical), value: -4.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948024; axis: 0 (vertical), value: -5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948034; axis: 0 (vertical), value: -6.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948044; axis: 0 (vertical), value: -5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948054; axis: 0 (vertical), value: -5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948064; axis: 0 (vertical), value: -7.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948075; axis: 0 (vertical), value: -5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948085; axis: 0 (vertical), value: -7.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948095; axis: 0 (vertical), value: -2.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948105; axis: 0 (vertical), value: -5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948115; axis: 0 (vertical), value: -7.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948125; axis: 0 (vertical), value: -6.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948135; axis: 0 (vertical), value: -6.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948146; axis: 0 (vertical), value: -5.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948156; axis: 0 (vertical), value: -13.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948166; axis: 0 (vertical), value: -3.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948176; axis: 0 (vertical), value: -3.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948196; axis: 0 (vertical), value: -1.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis: time: 948217; axis: 0 (vertical), value: -1.000000
[13:      wl_pointer] frame
[13:      wl_pointer] axis_source: 2 (continuous)
[13:      wl_pointer] axis_stop: time: 948309; axis: 0 (vertical)
[13:      wl_pointer] frame
tejohnso commented 2 years ago

Thanks @tokyovigilante

@JoseExposito I've confirmed that scroll does not work in Chromium, but does work in Firefox. And my record.txt output is similar to that of @tokyovigilante

JoseExposito commented 2 years ago

Thanks for the logs. I asked because there was a similar bug with a different trackpoint recently in libinput.... I can not help much with this one then :(