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

Scroll is too slow on Gnome/Wayland #461

Closed
akhilman opened this issue Jun 4, 2021 · 7 comments
Closed

Scroll is too slow on Gnome/Wayland #461

akhilman opened this issue Jun 4, 2021 · 7 comments
Labels
native-glium Relates to running egui_glium on native

Comments

@akhilman
Copy link

akhilman commented Jun 4, 2021

Scrolling speed is very slow in Gnome/Wayland using glium backend.
Screencast

There must be a way to solve all this scrolling mess.

Scroll event handling happens here:

let line_height = 8.0; // magic value!

Related issue with useful comments: #159 (comment)

Screencast.from.04-06-21.12.06.19.mp4
@emilk emilk added the native-glium Relates to running egui_glium on native label Jun 7, 2021
@emilk
Copy link
Owner

emilk commented Jun 7, 2021

See also #356

There must be a way to solve all this scrolling mess.

The solution is probably for people on different platforms to start contributing fixes to winit.

@akhilman
Copy link
Author

akhilman commented Jun 7, 2021

Seem like related to rust-windowing/winit#22.

@akhilman akhilman changed the title Scroll is to slow on Gnome/Wayland Scroll is too slow on Gnome/Wayland Jun 7, 2021
@akhilman
Copy link
Author

akhilman commented Jun 29, 2021

let line_height = 8.0; // magic value!

So, winit emits one 1 / -1 line delta event for each click of the scroller.
Where does the magic number 8 come from?

If this is the approximate line height of egui text, can we have a configurable number of lines per click of the scroller?

Is it ok If we extend GliumInputState or/and WindowSettings to have scrolling speed?

@akhilman
Copy link
Author

I tested the egui and winit's mouse_wheel example under Windows. Exactly the same result as in the gnome, one click - one event with a 1 / -1 delta and a scroll of only 8 pixels.

@akhilman
Copy link
Author

Similar issue in flutter flutter/flutter#71385

The GTK code uses pow(page_size, 2.0 / 3.0) as the scroll delta when scroll events are received as steps (source). The page_size is the height of the area being scrolled.

The Chromium uses 53 as scroller step.
The X11 - 40.
The imgui scrolls 5 lines per one wheel click.
The Iced uses 60px per one scroller click.

@WeiPhil
Copy link

WeiPhil commented Jul 12, 2021

I'm also facing this issue on Windows with the glium backend. Could we maybe, while this is not fixed in winit, provide a builder parameter to the scroll area and/or window scroll? Even if fixed, I can imagine a user parameter being useful, similar to how the dragValue speed can be changed.

@akhilman
Copy link
Author

Could we maybe, while this is not fixed in winit.

I don't think this is a winit problem, because it seems that one "line" of scroll means one click of the scroller, or about 15 degrees of wheel rotation.
In my opinion, the decision on what to do with this event depends on the application.

So we need to decide how to interpret one click of the scroll wheel.

There are also cases when the author of the application needs clicks, and not scrolling in pixels. For example, to change a value by one in the integer input area, or to select a weapon in a game.

akhilman added a commit to akhilman/egui that referenced this issue Sep 7, 2021
Each so called "line" in MuseScrollDelta::LineDelta de-facto represents
single scroller click which in most cases is 15 degrees of wheel
rotation.

Currently, one scroller click scrolls exactly one line of the text,
which is very slow.

This change multiplies the scroll rate by 5. So, with one click of the
scroller, 5 lines scrolled. This number is taken from the "iced" GUI
library and feels quite balanced.

Fixes emilk#461
akhilman added a commit to akhilman/egui that referenced this issue Sep 7, 2021
Each so called "line" of MuseScrollDelta::LineDelta de-facto represents
single scroller click which in most cases is 15 degrees of wheel
rotation.

Currently, one scroller click scrolls exactly one line of the text,
which is very slow.

This change multiplies the scroll rate by 5. So, with one click of the
scroller, 5 lines scrolled. This number is taken from the "iced" GUI
library and feels quite balanced.

Fixes emilk#461
akhilman added a commit to akhilman/egui that referenced this issue Sep 7, 2021
Each so called "line" of the MuseScrollDelta::LineDelta de-facto represents
a single scroller click which in most cases equals to 15 degrees of wheel
rotation.

Currently, one scroller click scrolls exactly one line of the text,
which is very slow.

This change multiplies the scroll rate by 5. So, with one click of the
scroller, 5 lines scrolled. This number is taken from the "iced" GUI
library and feels quite balanced.

Fixes emilk#461
@emilk emilk closed this as completed in 2498765 Sep 7, 2021
mankinskin pushed a commit to mankinskin/egui that referenced this issue Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native-glium Relates to running egui_glium on native
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants