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:
parent
2d2ce70edc
commit
cdd9b1e1eb
2 changed files with 6 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue