mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
io/router: use areas to determine targets for synthetic clicks
Before this change, semantic clicks would be delivered according to the center of the targeted widget, which could result in a different widget receiving the click. Or in worst case, no widget in case the center is not visible because of clipping. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-2
@@ -216,10 +216,11 @@ func (q *Router) ClickFocus() {
|
||||
Position: f32.Pt(float32(center.X), float32(center.Y)),
|
||||
Source: pointer.Touch,
|
||||
}
|
||||
area := q.key.queue.AreaFor(focus)
|
||||
e.Type = pointer.Press
|
||||
q.pointer.queue.Push(e, &q.handlers)
|
||||
q.pointer.queue.Deliver(area, e, &q.handlers)
|
||||
e.Type = pointer.Release
|
||||
q.pointer.queue.Push(e, &q.handlers)
|
||||
q.pointer.queue.Deliver(area, e, &q.handlers)
|
||||
}
|
||||
|
||||
// TextInputState returns the input state from the most recent
|
||||
|
||||
Reference in New Issue
Block a user