Support mouse scroll in X11.#961
Merged
xStrom merged 6 commits intolinebender:masterfrom May 20, 2020
jneem:x11-scroll
Merged
Conversation
xStrom
reviewed
May 18, 2020
Member
xStrom
left a comment
There was a problem hiding this comment.
Looks promising. I have a few requests.
| 6 => (-120.0, 0.0), | ||
| 7 => (120.0, 0.0), | ||
| _ => { | ||
| log::error!("unexpected mouse wheel button: {}", button); |
Member
There was a problem hiding this comment.
This is a good spot to return an error instead. Perhaps something like:
_ => return Err(Error::Generic(format!("unexpected mouse wheel button: {}", button))),
Member
Author
There was a problem hiding this comment.
I'm not sure if this affects your preferred error handling technique, but hitting this case represents a bug in druid-shell. It's impossible for now because we check that the button is between 4 and 7 before calling handle_wheel.
Member
There was a problem hiding this comment.
Yeah I think returning an error in case of invalid input parameters is just fine. Certainly better than generating a zero delta wheel event.
xStrom
reviewed
May 19, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #921.