expo: Always send keys to highlighted textline
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>
This commit is contained in:
19
boot/scene.c
19
boot/scene.c
@@ -1152,6 +1152,16 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event)
|
|||||||
return 0;
|
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) {
|
list_for_each_entry(obj, &scn->obj_head, sibling) {
|
||||||
if (obj->type == SCENEOBJT_MENU) {
|
if (obj->type == SCENEOBJT_MENU) {
|
||||||
struct scene_obj_menu *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)
|
if (ret)
|
||||||
return log_msg_ret("key", ret);
|
return log_msg_ret("key", ret);
|
||||||
break;
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user