mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 01:15:35 +00:00
io/input: permit FocusCmd to explicitly set the focus to any tag
If the client asks for the focus to be set to a tag, allow it. There is a check at the end of Router.Frame that clears the focus if the tag turns out to fail the requirements (visible and has asked for FocusEvents). The change simplifies the logic for determining whether a command can be executed immediately. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -281,11 +281,6 @@ func keyFilterMatch(f key.Filter, e key.Event) bool {
|
||||
}
|
||||
|
||||
func (q *keyQueue) Focus(handlers map[event.Tag]*handler, state keyState, focus event.Tag) (keyState, []taggedEvent) {
|
||||
if focus != nil {
|
||||
if h, exists := handlers[focus]; !exists || !h.filter.key.focusable || !h.key.visible {
|
||||
focus = nil
|
||||
}
|
||||
}
|
||||
if focus == state.focus {
|
||||
return state, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user