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

Reverse horizontal scrolling on windows #966

Merged
merged 2 commits into from
Dec 20, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ impl State {
// https://github.com/rust-windowing/winit/issues/1695 being closed
delta.x *= -1.0;
}
if cfg!(target_os = "windows") {
delta.x *= -1.0;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this is wrong on mac and windows, perhaps it is also wrong on linux? i.e perhaps we should just always invert delta.xno matter what platform

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. However, it's not clear to me how we find the correct answer. As mentioned in #356, it appears that it's not even consistent across Linux desktop environments.

The only dev environment I have readily available is windows. I didn't want to cause problems on systems I can't test, and I wanted to keep this PR tightly scoped.

Most importantly, this is really a workaround for an upstream winit issue. If I can get this rust-windowing/winit#2101 merged, the egui issue and PR for horizontal scrolling on Windows can be closed.

emilk marked this conversation as resolved.
Show resolved Hide resolved
}

if self.egui_input.modifiers.ctrl || self.egui_input.modifiers.command {
// Treat as zoom instead:
Expand Down