forked from joejulian/gio
io/input: [API] execute commands immediately
Change the semantics of commands to execute immediately. In cases where execution of a command introduces a inconsistency, freeze event routing and defer the command as well as queued events to the next frame. Rename Source.Queue to Source.Execute to better fit the new command semantics. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+2
-2
@@ -315,7 +315,7 @@ func (s *Scroll) Update(cfg unit.Metric, q input.Source, t time.Time, axis Axis,
|
||||
if e.Priority < pointer.Grabbed {
|
||||
slop := cfg.Dp(touchSlop)
|
||||
if dist := dist; dist >= slop || -slop >= dist {
|
||||
q.Queue(pointer.GrabCmd{Tag: s, ID: e.PointerID})
|
||||
q.Execute(pointer.GrabCmd{Tag: s, ID: e.PointerID})
|
||||
}
|
||||
} else {
|
||||
s.last = v
|
||||
@@ -389,7 +389,7 @@ func (d *Drag) Update(cfg unit.Metric, q input.Source, axis Axis) []pointer.Even
|
||||
diff := e.Position.Sub(d.start)
|
||||
slop := cfg.Dp(touchSlop)
|
||||
if diff.X*diff.X+diff.Y*diff.Y > float32(slop*slop) {
|
||||
q.Queue(pointer.GrabCmd{Tag: d, ID: e.PointerID})
|
||||
q.Execute(pointer.GrabCmd{Tag: d, ID: e.PointerID})
|
||||
}
|
||||
}
|
||||
case pointer.Release, pointer.Cancel:
|
||||
|
||||
Reference in New Issue
Block a user