mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
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:
@@ -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
@@ -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.
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user