mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-24 06:11:30 +11:00
Use send_events instead of send_event in web backend (#1681)
This commit is contained in:
parent
0f7c82d38f
commit
bea60930b6
|
@ -137,15 +137,16 @@ impl<T> WindowTarget<T> {
|
|||
// A mouse down event may come in without any prior CursorMoved events,
|
||||
// therefore we should send a CursorMoved event to make sure that the
|
||||
// user code has the correct cursor position.
|
||||
runner.send_event(Event::WindowEvent {
|
||||
runner.send_events(
|
||||
std::iter::once(Event::WindowEvent {
|
||||
window_id: WindowId(id),
|
||||
event: WindowEvent::CursorMoved {
|
||||
device_id: DeviceId(device::Id(pointer_id)),
|
||||
position,
|
||||
modifiers,
|
||||
},
|
||||
});
|
||||
runner.send_event(Event::WindowEvent {
|
||||
})
|
||||
.chain(std::iter::once(Event::WindowEvent {
|
||||
window_id: WindowId(id),
|
||||
event: WindowEvent::MouseInput {
|
||||
device_id: DeviceId(device::Id(pointer_id)),
|
||||
|
@ -153,7 +154,8 @@ impl<T> WindowTarget<T> {
|
|||
button,
|
||||
modifiers,
|
||||
},
|
||||
});
|
||||
})),
|
||||
);
|
||||
});
|
||||
|
||||
let runner = self.runner.clone();
|
||||
|
|
Loading…
Reference in a new issue