mirror of
https://github.com/rust-windowing/winit.git
synced 2026-06-27 23:23:14 -04:00
web: Manually emit focused event on mouse click (#2202)
* Manually emit focused event on mouse click * Update CHANGELOG.md Co-authored-by: Markus Røyset <maroider@protonmail.com> Co-authored-by: Markus Røyset <maroider@protonmail.com>
This commit is contained in:
@@ -160,13 +160,17 @@ impl<T> EventLoopWindowTarget<T> {
|
||||
// user code has the correct cursor position.
|
||||
runner.send_events(
|
||||
std::iter::once(Event::WindowEvent {
|
||||
window_id: RootWindowId(id),
|
||||
event: WindowEvent::Focused(true),
|
||||
})
|
||||
.chain(std::iter::once(Event::WindowEvent {
|
||||
window_id: RootWindowId(id),
|
||||
event: WindowEvent::CursorMoved {
|
||||
device_id: RootDeviceId(DeviceId(pointer_id)),
|
||||
position,
|
||||
modifiers,
|
||||
},
|
||||
})
|
||||
}))
|
||||
.chain(std::iter::once(Event::WindowEvent {
|
||||
window_id: RootWindowId(id),
|
||||
event: WindowEvent::MouseInput {
|
||||
|
||||
Reference in New Issue
Block a user