mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 08:25:34 +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:
+5
-1
@@ -66,7 +66,11 @@ func (e *Enum) Update(gtx layout.Context) bool {
|
||||
if e.focused && e.focus == state.key {
|
||||
filters = append(filters, key.Filter{Name: key.NameReturn}, key.Filter{Name: key.NameSpace})
|
||||
}
|
||||
for _, ev := range gtx.Events(&state.tag, filters...) {
|
||||
for {
|
||||
ev, ok := gtx.Event(&state.tag, filters...)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
switch ev := ev.(type) {
|
||||
case key.FocusEvent:
|
||||
if ev.Focus {
|
||||
|
||||
Reference in New Issue
Block a user