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

Touchpad Scroll on Wayland not working #2236

Closed
jwrober opened this issue Mar 26, 2024 · 7 comments · Fixed by #2269
Closed

Touchpad Scroll on Wayland not working #2236

jwrober opened this issue Mar 26, 2024 · 7 comments · Fixed by #2269
Labels
bug Something isn't working gui This issue requires changes to the user interface
Milestone

Comments

@jwrober
Copy link
Collaborator

jwrober commented Mar 26, 2024

Describe the bug
The touchpad scroll only works left/right, up/down and not diagonally on Wayland. Is also laggy/slow. Works fine on X11

To Reproduce
Steps to reproduce the behavior:

  1. Set your Linux to use Wayland instead of X11
  2. Open a game
  3. See error

Expected behavior
Mouse events work same on Wayland as on X11

Screenshots
N/A

Platform and version (please complete the following information):

  • OS: Linux
  • Freeciv21 version: 3.1-alpha.5
  • Ruleset/Longturn game (if applicable): N/A

Additional context
https://discord.com/channels/378908274113904641/1109113177779732550/1215113440033636464

@jwrober jwrober added bug Something isn't working gui This issue requires changes to the user interface labels Mar 26, 2024
@lmoureaux
Copy link
Contributor

Is this KWin-specific or do you see the same on Mutter?

@jwrober
Copy link
Collaborator Author

jwrober commented Mar 26, 2024

I'm also on KWin and can reproduce there.

@lmoureaux
Copy link
Contributor

But is it related to KWin or does Gnome give the same?

@blabber
Copy link
Collaborator

blabber commented Mar 26, 2024

FWIW, I can't reproduce this on FreeBSD running sway

@jwrober jwrober added this to the v3.1-stable milestone Mar 30, 2024
@lmoureaux
Copy link
Contributor

Works like a charm when using the xcb backend with QT_QPA_PLATFORM=xcb (so going through XWayland).

@lmoureaux
Copy link
Contributor

Scrolling events come in two modes, pixel-based and angle-based. On we get deltas of the form pixel=QPoint(0,0) angle=QPoint(0,21) and use the angle ones. On wayland we get deltas like pixel=QPoint(0,-4) angle=QPoint(0,-58), and use the pixel ones.
From the documentation:

Wheel events are generated for both mouse wheels and trackpad scroll gestures. There are two ways to read the wheel event delta: angleDelta() returns the deltas in wheel degrees. These values are always provided. pixelDelta() returns the deltas in screen pixels, and is available on platforms that have high-resolution trackpads, such as macOS. If that is the case, source() will return Qt::MouseEventSynthesizedBySystem.

Events on Wayland have Qt::MouseEventSynthesizedBySystem, events on XCB have Qt::MouseEventNotSynthesized.

--> How are we supposed to use the pixel deltas in the first place? They don't feel like pixel differences at all.

@lmoureaux
Copy link
Contributor

--> How are we supposed to use the pixel deltas in the first place? They don't feel like pixel differences at all.

Qt itself uses angleDelta everywhere. Will follow suit

lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Apr 9, 2024
Using pixelDelta() resulted in seemingly meaningless values on
KWin/Wayland. Qt code uses angleDelta() exclusively, so I see no reason
not to do the same.

Closes longturn#2236.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Apr 9, 2024
Using pixelDelta() resulted in seemingly meaningless values on
KWin/Wayland. Qt code uses angleDelta() exclusively, so I see no reason
not to do the same.

Closes longturn#2236.
jwrober pushed a commit that referenced this issue Apr 10, 2024
Using pixelDelta() resulted in seemingly meaningless values on
KWin/Wayland. Qt code uses angleDelta() exclusively, so I see no reason
not to do the same.

Closes #2236.
lmoureaux added a commit that referenced this issue Oct 26, 2024
Using pixelDelta() resulted in seemingly meaningless values on
KWin/Wayland. Qt code uses angleDelta() exclusively, so I see no reason
not to do the same.

Closes #2236.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gui This issue requires changes to the user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants