mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
io/router/key: add explicit tag to FocusOp; make last SoftKeyboardOp apply
The target of FocusOp is too subtle; be explicit instead and remove any doubt. Multiple SoftKeyboardOp in a single frame is rare, but if they do occur, they should behave as if they were from separate frames: the last one applies. As a side-effect the key event router can be much simplified. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -54,7 +54,7 @@ const (
|
||||
TypeClipboardReadLen = 1
|
||||
TypeClipboardWriteLen = 1
|
||||
TypeKeyInputLen = 1
|
||||
TypeKeyFocusLen = 1 + 1
|
||||
TypeKeyFocusLen = 1
|
||||
TypeKeySoftKeyboardLen = 1 + 1
|
||||
TypeSaveLen = 1 + 4
|
||||
TypeLoadLen = 1 + 1 + 4
|
||||
@@ -115,7 +115,7 @@ func (t OpType) Size() int {
|
||||
|
||||
func (t OpType) NumRefs() int {
|
||||
switch t {
|
||||
case TypeKeyInput, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite, TypeCursor:
|
||||
case TypeKeyInput, TypeKeyFocus, TypePointerInput, TypeProfile, TypeCall, TypeClipboardRead, TypeClipboardWrite, TypeCursor:
|
||||
return 1
|
||||
case TypeImage:
|
||||
return 2
|
||||
|
||||
Reference in New Issue
Block a user