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

Native: Scroll direction varies by platform #356

Closed
EmbersArc opened this issue May 7, 2021 · 9 comments
Closed

Native: Scroll direction varies by platform #356

EmbersArc opened this issue May 7, 2021 · 9 comments
Labels
bug Something is broken egui-winit porblems related to winit help wanted Extra attention is needed

Comments

@EmbersArc
Copy link
Contributor

Describe the bug
As we noticed in #349 (comment):
On Linux, the two-finger scroll delta reported by ui.input().scroll_delta is positive to the right and up. I can enable "natural scrolling" in the settings and this reverses the direction on both axes. Apparently this is different on other platforms, namely on Mac.

To Reproduce
Steps to reproduce the behavior:

  1. Use ui.input().scroll_delta to get the scroll delta when using the touchpad with two fingers
  2. The signs of the values may vary depending on the platform that egui is used on

Expected behavior
That the reported values are always the same.

Desktop:
Operating System: Manjaro Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.12.1-2-MANJARO
OS Type: 64-bit
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-9750H CPU @ 2.60GHz
Memory: 15.3 GiB of RAM
Graphics Processor: GeForce GTX 1650 with Max-Q Design/PCIe/SSE2

@EmbersArc EmbersArc added the bug Something is broken label May 7, 2021
@emilk emilk added the native-glium Relates to running egui_glium on native label May 8, 2021
@emilk emilk changed the title Scroll delta value varies by platform Native: Scroll delta value varies by platform May 8, 2021
@emilk emilk added the help wanted Extra attention is needed label May 8, 2021
@emilk
Copy link
Owner

emilk commented May 8, 2021

On my macbook (macOS Mojave) the positive scroll direction is down and to the right (with "natural scrolling" turned on). This is the correct direction, and same as the positive mouse delta.

@emilk
Copy link
Owner

emilk commented May 8, 2021

I'd like to get a few more voices on this before taking action. This may be an issue with KDE, Linux, or all non-Mac platforms.

So please test the scroll direction by checking out latest master, cargo run --release and check the scroll_delta values in the "Inspection" window.

@follower
Copy link
Contributor

follower commented May 8, 2021

It might be helpful to re-title this issue "...scroll delta sign/direction..." given that there is was also a recently existing issue (#159) which is actually about the magnitude of the scroll value.

@emilk emilk changed the title Native: Scroll delta value varies by platform Native: Scroll direction varies by platform May 8, 2021
@akhilman
Copy link

I tested two finger scrolling on Xfce-4.12 with "Reverse scroll direction" enabled.
Moving fingers up and right gives negative values, left and down - positive values.
Overall the up/down scroll direction is correct (as in any other app). But the speed is low.

@emilk emilk added egui-winit porblems related to winit and removed native-glium Relates to running egui_glium on native labels Sep 30, 2021
@emilk
Copy link
Owner

emilk commented Sep 30, 2021

This should be worked on in winit if anyone has the energy to work on it

@aevyrie
Copy link
Contributor

aevyrie commented Dec 17, 2021

On windows, I'm experiencing horizontal scroll going the wrong direction.
Scrolling anywhere other than egui results in "natural" scrolling in x and y.
In egui (native), scrolling in x is flipped, y is correct. This is not the case on the web, where scrolling works as expected.

@akhilman
Copy link

akhilman commented Dec 18, 2021 via email

@aevyrie
Copy link
Contributor

aevyrie commented Dec 18, 2021

I've PR'd winit. If anyone else has platforms with the same issue, take a look at my PR. It's super small change to the platform impl.

@emilk
Copy link
Owner

emilk commented Dec 20, 2021

Fix wrong hscroll in winit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken egui-winit porblems related to winit help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants