From: Simon Glass <simon.glass@canonical.com> Move textline key handling outside the loop so keys are always sent to the highlighted textline, regardless of whether it is open. This allows the textline to respond to keyboard input even if not in a popup expo. Otherwise continue to send keys to menus as now. Signed-off-by: Simon Glass <simon.glass@canonical.com> --- boot/scene.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 1bcc3c39e33..5c19bff6011 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1152,6 +1152,16 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) return 0; } + if (cur && cur->type == SCENEOBJT_TEXTLINE) { + struct scene_obj_textline *tline; + + tline = (struct scene_obj_textline *)cur; + ret = scene_textline_send_key(scn, tline, key, event); + if (ret) + return log_msg_ret("key", ret); + return 0; + } + list_for_each_entry(obj, &scn->obj_head, sibling) { if (obj->type == SCENEOBJT_MENU) { struct scene_obj_menu *menu; @@ -1161,15 +1171,6 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) if (ret) return log_msg_ret("key", ret); break; - } else if (!(obj->flags & SCENEOF_OPEN) && - obj->type == SCENEOBJT_TEXTLINE) { - struct scene_obj_textline *tline; - - tline = (struct scene_obj_textline *)obj; - ret = scene_textline_send_key(scn, tline, key, event); - if (ret) - return log_msg_ret("key", ret); - break; } } -- 2.43.0