Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

return coordinates in MouseWheel events - #109

Merged
bors-servo merged 1 commit into
servo:servofrom
gterzian:return_mouse_coords_in_wheel_events
Jan 22, 2017
Merged

bors-servo merged 1 commit into
servo:servofrom
gterzian:return_mouse_coords_in_wheel_events

Conversation

@gterzian

@gterzian gterzian commented Dec 31, 2016 •

Copy link
Copy Markdown
Member

Glutin side of servo/servo#14808 to fix servo/servo#14290, it's a follow up from #97


This change is Reviewable

Comment thread src/events.rs

/// A mouse wheel movement or touchpad scroll occurred.
MouseWheel(MouseScrollDelta, TouchPhase),
MouseWheel(MouseScrollDelta, TouchPhase, Option<(i32, i32)>),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes.

Comment thread src/events.rs
MouseWheel(MouseScrollDelta, TouchPhase, Option<(i32, i32)>),

/// An event from the mouse has been received.
MouseInput(ElementState, MouseButton, Option<(i32, i32)>),

@gterzian gterzian Dec 31, 2016 •

Copy link
Copy Markdown
Member Author

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>)

@jdm

jdm commented Dec 31, 2016

Copy link
Copy Markdown
Member

This should be submitted upstream as well.

@gterzian

gterzian commented Jan 1, 2017

Copy link
Copy Markdown
Member Author

@jdm thanks for pointing that out. Once it's reviewed and ready to go, I'll make usre to also submit it upstream...

@gterzian

gterzian commented Jan 1, 2017 •

Copy link
Copy Markdown
Member Author

@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?

@jdm

jdm commented Jan 1, 2017

Copy link
Copy Markdown
Member

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.

@paulrouget

Copy link
Copy Markdown

I don't know the cost of get_mouse_position. Maybe we should only add the coordinate when the phase is Started?

@gterzian

Copy link
Copy Markdown
Member Author

@paulrouget good idea, made the change, all still seems to work...

@paulrouget

paulrouget commented Jan 16, 2017 •

Copy link
Copy Markdown

Looks good to me (with version bump), but I can only review Tomaka's glutin.

Anyone want to review this?

@gterzian
gterzian force-pushed the return_mouse_coords_in_wheel_events branch 3 times, most recently from e477fec to a45969b Compare January 17, 2017 15:26
@nox

nox commented Jan 17, 2017

Copy link
Copy Markdown

The bump should be 0.7 given it's a breaking change.

r? @pcwalton

@bors-servo

Copy link
Copy Markdown

☔ The latest upstream changes (presumably #111) made this pull request unmergeable. Please resolve the merge conflicts.

@pcwalton

Copy link
Copy Markdown

This looks good to me. Squash and I'll r+

@jdm jdm assigned pcwalton and unassigned nox Jan 20, 2017
@gterzian
gterzian force-pushed the return_mouse_coords_in_wheel_events branch 6 times, most recently from b238948 to 1dfd538 Compare January 22, 2017 14:32
@gterzian
gterzian force-pushed the return_mouse_coords_in_wheel_events branch from 1dfd538 to ace7e62 Compare January 22, 2017 14:34
@gterzian

gterzian commented Jan 22, 2017 •

Copy link
Copy Markdown
Member Author

@pcwalton thanks for the review, it has been squashed...

@jdm

jdm commented Jan 22, 2017

Copy link
Copy Markdown
Member

@bors-servo: r=pcwalton

@bors-servo

Copy link
Copy Markdown

📌 Commit ace7e62 has been approved by pcwalton

@bors-servo

Copy link
Copy Markdown

⚡ Test exempted - status

@bors-servo
bors-servo merged commit ace7e62 into servo:servo Jan 22, 2017
bors-servo pushed a commit that referenced this pull request Jan 22, 2017
…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 -->
@paulrouget paulrouget mentioned this pull request Nov 6, 2017
3 tasks done
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When Servo isn't the window directly in front, scroll is stuck in previously scrolled layer

6 participants