io/router: deliver Release before Leave

Fixes a problem where a touch Release would signal gesture.Click
that it had left just before click would complete.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2020-06-08 21:31:23 +02:00
parent 1ace1392d6
commit 652f1ecd47
2 changed files with 3 additions and 5 deletions
+1 -3
View File
@@ -245,6 +245,7 @@ func (q *pointerQueue) Push(e pointer.Event, events *handlerEvents) {
}
if e.Type == pointer.Release {
q.deliverEvent(p, events, e)
p.pressed = false
}
q.scratch = q.scratch[:0]
@@ -259,9 +260,6 @@ func (q *pointerQueue) Push(e pointer.Event, events *handlerEvents) {
}
q.deliverEnterLeaveEvents(p, q.scratch, events, e)
if e.Type == pointer.Release {
q.deliverEvent(p, events, e)
}
if !p.pressed {
p.handlers = append(p.handlers[:0], q.scratch...)
}