io/pointer: delete Foremost priority

It wasn't used, and it's not clear that it is useful at all in its current
form. For example, a single control with multiple handler keys (say, one for
scrolling and one for clicking) will only receive priority Foremost for one of
them.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-10-12 16:31:23 +02:00
parent 651e31f7e0
commit e1de1ba591
3 changed files with 4 additions and 12 deletions
+2 -5
View File
@@ -236,14 +236,11 @@ func (q *pointerQueue) Push(e pointer.Event, events *handlerEvents) {
if e.Type == pointer.Release {
q.pointers = append(q.pointers[:pidx], q.pointers[pidx+1:]...)
}
for i, k := range p.handlers {
for _, k := range p.handlers {
h := q.handlers[k]
e := e
switch {
case p.pressed && len(p.handlers) == 1:
if p.pressed && len(p.handlers) == 1 {
e.Priority = pointer.Grabbed
case i == 0:
e.Priority = pointer.Foremost
}
e.Hit = q.hit(h.area, e.Position)
e.Position = h.transform.Invert().Transform(e.Position)
+2 -2
View File
@@ -95,8 +95,8 @@ For multiple grabbing handlers, the foremost handler wins.
Priorities
Handlers know their position in a matching set of a pointer through
event priorities. The Shared and Foremost priorities are for matching sets
with multiple handlers; the Grabbed priority indicate exclusive access.
event priorities. The Shared priority is for matching sets with
multiple handlers; the Grabbed priority indicate exclusive access.
Priorities are useful for deferred gesture matching.
-5
View File
@@ -112,9 +112,6 @@ const (
// Shared priority is for handlers that
// are part of a matching set larger than 1.
Shared Priority = iota
// Foremost is like Shared, but the handler is
// the foremost in the matching set.
Foremost
// Grabbed is used for matching sets of size 1.
Grabbed
)
@@ -187,8 +184,6 @@ func (p Priority) String() string {
switch p {
case Shared:
return "Shared"
case Foremost:
return "Foremost"
case Grabbed:
return "Grabbed"
default: