mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
io/key,io/pointer: forbid nil tags for InputOps
Forcing a non-nil tag ensures that all handler tags are either unique, or intentionally equal. Additionally, a nil tag has special meaning in FocusOps. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -189,6 +189,9 @@ func (op CursorNameOp) Add(o *op.Ops) {
|
||||
}
|
||||
|
||||
func (h InputOp) Add(o *op.Ops) {
|
||||
if h.Tag == nil {
|
||||
panic("Tag must be non-nil")
|
||||
}
|
||||
data := o.Write1(opconst.TypePointerInputLen, h.Tag)
|
||||
data[0] = byte(opconst.TypePointerInput)
|
||||
if h.Grab {
|
||||
|
||||
Reference in New Issue
Block a user