mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
all: [API] deliver events one at a time to allow fine-grained event processing
Processing one event at a time allows a widget to execute commands after the event that triggered it, instead of after all matching events. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -319,7 +319,11 @@ func (e *Selectable) processKey(gtx layout.Context) {
|
||||
key.Filter{Name: "A", Required: key.ModShortcut},
|
||||
)
|
||||
}
|
||||
for _, ke := range gtx.Events(e, filters...) {
|
||||
for {
|
||||
ke, ok := gtx.Event(e, filters...)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
switch ke := ke.(type) {
|
||||
case key.FocusEvent:
|
||||
e.focused = ke.Focus
|
||||
|
||||
Reference in New Issue
Block a user