mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
io/router: avoid a decode round for key ops
Like a previous change for pointer ops, process key ops during the router decode of ops. This is a performance optimization and preparation for processing future accessibility ops without without another decode loop. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -268,14 +268,14 @@ func assertKeyEventUnexpected(t *testing.T, events []event.Event) {
|
||||
|
||||
func assertFocus(t *testing.T, router *Router, expected event.Tag) {
|
||||
t.Helper()
|
||||
if router.kqueue.focus != expected {
|
||||
t.Errorf("expected %v to be focused, got %v", expected, router.kqueue.focus)
|
||||
if got := router.key.queue.focus; got != expected {
|
||||
t.Errorf("expected %v to be focused, got %v", expected, got)
|
||||
}
|
||||
}
|
||||
|
||||
func assertKeyboard(t *testing.T, router *Router, expected TextInputState) {
|
||||
t.Helper()
|
||||
if router.kqueue.state != expected {
|
||||
t.Errorf("expected %v keyboard, got %v", expected, router.kqueue.state)
|
||||
if got := router.key.queue.state; got != expected {
|
||||
t.Errorf("expected %v keyboard, got %v", expected, got)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user