Send mouse position after focused/cursorenter events#349
Send mouse position after focused/cursorenter events#349elinorbgr merged 9 commits intorust-windowing:masterfrom
Conversation
|
It's worth noting the machinery with the VecDeque isn't needed in the OSx backend. You can just push_back an event into the Vec you're extending from the Iterator. Otherwise this looks great! |
|
Sorry I didn't make myself very clear, this is actually what I meant. let x = (scale_factor * view_point.x as f32) as f64;
let y = (scale_factor * (view_rect.size.height - view_point.y) as f32) as f64;
let window_event = WindowEvent::CursorMoved { device_id: DEVICE_ID, position: (x, y) };
self.shared.pending_events.lock().unwrap().push_back(window_event); |
|
No worries, thanks for clarifying! |
|
Looks great, thanks! |
|
Let me know if there's anything else to do! Assuming this gets merged, what's the process for bumping the version? I'm hoping to get this merged into glutin as soon as possible so I can unblock servo/servo#19120 |
|
Amethyst also has interest in pushing to cargo so we can start using #344 |
Just submit another PR with a version bump in the Cargo.toml and the changelog. |
|
I take it we need some reviews from collaborators to merge this. @vberger reviewed and merged my last input-related PR so I'll ping him for this one. |
|
well, this looks good to me, but it touches all the backends I'm not familiar with... Did you test it on windows, macos and x11 ? |
|
I only was able to test it on macos and x11, which worked. I don't have access to a windows machine, unfortunately. |
|
I'll give this a shot on Windows tonight (approximately 10-11 hours from the time on this comment) |
|
@vberger @stuartnelson3 This works on Windows. Not related to this PR, but interestingly I don't get Device and MouseMoved events when the window isn't focused, so our existing documentation is actually a bit incorrect on that. |
|
Is there anything to be done to move this PR forward? |
|
All is good, sorry for the delay! |
…oesn't) handle that case. Closes rust-windowing#349.
`usvg` should never have nested `<svg>` nodes, so remove code that (doesn't) handle that case. Closes rust-windowing#349.
…ndowing#349) * fix(events): properly fire `WindowEvent::Destroyed` on Linux * remove unused variable * fix docs
This is a first pass at updating the mouse's position after a CursorEntered/Focused event. I ran
cargo testbut haven't done any manual testing.There's a lot of copy/paste in the macos code. I'm also not sure how best to send a second event in that situation.
fixes #348