-
Notifications
You must be signed in to change notification settings - Fork 33
return coordinates in MouseWheel events #109
return coordinates in MouseWheel events #109
Conversation
ce45257
to
d2d02c4
Compare
@@ -31,7 +31,7 @@ pub enum Event { | |||
MouseMoved(i32, i32), | |||
|
|||
/// A mouse wheel movement or touchpad scroll occurred. | |||
MouseWheel(MouseScrollDelta, TouchPhase), | |||
MouseWheel(MouseScrollDelta, TouchPhase, Option<(i32, i32)>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I bump up a version, since this does change the public API? (used in Servo at https://github.com/servo/servo/blob/master/ports/glutin/window.rs#L19)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
@@ -31,7 +31,7 @@ pub enum Event { | |||
MouseMoved(i32, i32), | |||
|
|||
/// A mouse wheel movement or touchpad scroll occurred. | |||
MouseWheel(MouseScrollDelta, TouchPhase), | |||
MouseWheel(MouseScrollDelta, TouchPhase, Option<(i32, i32)>), | |||
|
|||
/// An event from the mouse has been received. | |||
MouseInput(ElementState, MouseButton, Option<(i32, i32)>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would we want to create a MousePosition
struct, to try to be more descriptive than the current Option<(i32, i32)>
?
That way we could have:
MouseInput(ElementState, MouseButton, Option<MousePosition>)
MouseWheel(MouseScrollDelta, TouchPhase, Option<MousePosition>)
This should be submitted upstream as well. |
@jdm thanks for pointing that out. Once it's reviewed and ready to go, I'll make usre to also submit it upstream... |
@jdm actually I just saw this repo is 111 commits ahead of the upstream... Perhaps we should submit a PR all in one go to propose the sync? Or should all those other changes not be submitted, while this one should? |
It's more complicated than that, unfortunately. Those commits being counted are merges with upstream, I'm pretty sure. The actual number of changes we have not upstreamed is quite small. |
I don't know the cost of |
@paulrouget good idea, made the change, all still seems to work... |
Looks good to me (with version bump), but I can only review Tomaka's glutin. Anyone want to review this? |
e477fec
to
a45969b
Compare
The bump should be 0.7 given it's a breaking change. r? @pcwalton |
☔ The latest upstream changes (presumably #111) made this pull request unmergeable. Please resolve the merge conflicts. |
This looks good to me. Squash and I'll r+ |
b238948
to
1dfd538
Compare
1dfd538
to
ace7e62
Compare
@pcwalton thanks for the review, it has been squashed... |
@bors-servo: r=pcwalton |
📌 Commit ace7e62 has been approved by |
⚡ Test exempted - status |
…pcwalton return coordinates in MouseWheel events Glutin side of servo/servo#14808 to fix servo/servo#14290, it's a follow up from #97 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/glutin/109) <!-- Reviewable:end -->
Glutin side of servo/servo#14808 to fix servo/servo#14290, it's a follow up from #97
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)