Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse wheel distance/speed #133

Open
xf- opened this issue May 15, 2024 · 7 comments
Open

Mouse wheel distance/speed #133

xf- opened this issue May 15, 2024 · 7 comments

Comments

@xf-
Copy link

xf- commented May 15, 2024

Still broken - build the client and server on latest main commit

Server & client Wayland to Wayland

Fixed - inverted scroll direction

@feschber
Copy link
Owner

What desktop? KDE?

@xf-
Copy link
Author

xf- commented May 16, 2024

What desktop? KDE?

Yes on both. Like I wrote in the other issue, reverting the change helps.

@feschber
Copy link
Owner

I've tried pretty much anything but unfortunately there seems to be a bug with the KDE remote desktop portal implementation.

It might just be that they report 0 discrete scroll steps here: https://invent.kde.org/plasma/kwin/-/blame/master/src/backends/fakeinput/fakeinputbackend.cpp#L153

Basically there is two kinds of scroll events: Axis and AxisDiscrete120.
Axis is for touchpads and given in pixels, while AxisDiscrete120 is given in wheelsteps with each step being equal to 120 in value.

Now the xdg-desktop-portal-kde, which is being used here calls to the fake_input protocol:
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/remotedesktop.cpp?ref_type=heads#L322
https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/blob/master/src/waylandintegration.cpp?ref_type=heads#L414
while translating discrete scroll events into fakeinput "Axis" events which are handled in kwin:

https://invent.kde.org/plasma/kwin/-/blame/master/src/backends/fakeinput/fakeinputbackend.cpp#L132

Kwin calls to pointerAxisChanged while setting discrete Scrolling steps to 0...

So all of this seems to be fundamentally broken in KWIN itself and I fear there is nothing I can do right now to fix it.

I will however make sure to report it upstream

@xf-
Copy link
Author

xf- commented May 16, 2024

THX for your work. I still have my patched build and it works.

@feschber
Copy link
Owner

THX for your work. I still have my patched build and it works.

It's not perfect though, right? In firefox, at least from my testing it always jumped around a bit and did not scroll smoothly (instead jumping to the next possition directly).
Regardless, I can see if I can replicate the behaviour to what your patch looks like as closely as possible.

Do you mean the state before e21ab02 or the current master with e21ab02 reverted?

@xf-
Copy link
Author

xf- commented May 18, 2024

THX for your work. I still have my patched build and it works.

It's not perfect though, right? In firefox, at least from my testing it always jumped around a bit and did not scroll smoothly (instead jumping to the next possition directly). Regardless, I can see if I can replicate the behaviour to what your patch looks like as closely as possible.

Do you mean the state before e21ab02 or the current master with e21ab02 reverted?

Yeah, it is more or less the old function. It inverts the scrolling, but the speed is normal. So no 120 implementation. I use current release with reverting to this without 120
e21ab02#diff-c04e25924525b7dc3115df2f79d08fd1eecbbd91bf16f575fcba89e885205f05L737-L772

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants