jscene: make FOCUS_{IN,OUT} events propagate up

This commit is contained in:
Lephenixnoir 2021-05-25 21:58:59 +02:00
parent 846a96db4b
commit 6f6af63ec3
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -128,12 +128,14 @@ void jscene_set_focused_widget(jscene *s, void *w0)
} }
/* Focus out old focused widget */ /* Focus out old focused widget */
if(s->focus) jwidget_event(s->focus,(jevent){ .type = JWIDGET_FOCUS_OUT }); if(s->focus) jscene_queue_event(s,
(jevent){ .type = JWIDGET_FOCUS_OUT, .source = s->focus });
s->focus = w; s->focus = w;
/* Focus in newly-selected widget */ /* Focus in newly-selected widget */
if(w) jwidget_event(w, (jevent){ .type = JWIDGET_FOCUS_IN }); if(w) jscene_queue_event(s,
(jevent){ .type = JWIDGET_FOCUS_IN, .source = w });
} }
bool jscene_process_key_event(jscene *scene, key_event_t event) bool jscene_process_key_event(jscene *scene, key_event_t event)