io/router: account for parent clip areas when scrolling focus into view

Fixes: https://todo.sr.ht/~eliasnaur/gio/389
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-04-02 15:49:41 +02:00
parent 36919ef756
commit bd7f50438a
3 changed files with 17 additions and 1 deletions
+12
View File
@@ -845,6 +845,18 @@ func (q *pointerQueue) deliverTransferCancelEvent(p *pointerInfo, events *handle
p.dataTarget = nil
}
// ClipFor clips r to the parents of area.
func (q *pointerQueue) ClipFor(area int, r image.Rectangle) image.Rectangle {
a := &q.areas[area]
parent := a.parent
for parent != -1 {
a := &q.areas[parent]
r = r.Intersect(a.bounds())
parent = a.parent
}
return r
}
func searchTag(tags []event.Tag, tag event.Tag) (int, bool) {
for i, t := range tags {
if t == tag {