mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-04 00:45:35 +00:00
io/pointer: add Drag event type
This eliminates needless redraws for handlers that care about drag events and not move events, like gesture.Scroll. Signed-off-by: Gordon Klaus <gordon.klaus@gmail.com>
This commit is contained in:
@@ -235,6 +235,10 @@ func (q *pointerQueue) Push(e pointer.Event, events *handlerEvents) {
|
||||
}
|
||||
p := &q.pointers[pidx]
|
||||
|
||||
if e.Type == pointer.Move && p.pressed {
|
||||
e.Type = pointer.Drag
|
||||
}
|
||||
|
||||
q.deliverEnterLeaveEvents(p, events, e)
|
||||
if e.Type == pointer.Release {
|
||||
q.deliverEvent(p, events, e)
|
||||
|
||||
Reference in New Issue
Block a user