Fix x11 mouse scroll wheel#218
Conversation
Scroll direction seems correct to me--positive is down and right. What behavior are you observing? What do other platforms do? Bear in mind that some platforms (e.g. OSX) have a reversed direction convention.
That part looks good, thanks. |
|
Well this is weird. Found a file in /etc/X11/xorg.conf.d I removed the file and rebooted. Then I readded the file and rebooted. The file has probably been there for years. (I dont actually know why I added it or what it was for) I guess its just an X11 bug that didnt occur in the previous way winit used the API. |
|
I have removed my incorrect change to direction. The scroll position update should be good to merge. |
Ralith
left a comment
There was a problem hiding this comment.
Looks good, just one quibble.
src/platform/linux/x11/mod.rs
Outdated
| if ffi::XIMaskIsSet(mask, i) { | ||
| if let Some(&mut (_, ref mut info)) = physical_device.scroll_axes.iter_mut().find(|&&mut (axis, _)| axis == i) { | ||
| let delta = (unsafe { *value } - info.position) / info.increment; | ||
| let delta = (unsafe { *value } - info.position) / info.increment; // TODO: Doesn't handle underflow/overflow |
There was a problem hiding this comment.
Is overflow a realistic concern here? The range of double is astronomical, and we're only computing differences between successive values delivered by X.
|
Didnt pay attention to the type, good point! |
| [package] | ||
| name = "winit" | ||
| version = "0.7.2" | ||
| version = "0.7.3" |
There was a problem hiding this comment.
I think bumping this is usually left for the maintainer to do immediately prior to making a release.
|
I don't mind the version bump. |
fixes and a possible canvas addition
Fixes: #217
(unsafe { *value } - info.position)