From patchwork Sun Dec 7 20:16:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 828 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138674; bh=bgEroj+aCScHTZivGfjIOv3K5cK1f48IQ6mI9NbzcQs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cmdpKyAqnaWm/0XYNZ4osfgmbdWwDkBZhKhQoi18oEt3cDg1dPRJOI6/8phYimqtO rm984epJP/lUKyWXNNTSD62Gqv01SCpiGQoOnRH+qaubPMAa0KiBP6yfDgbFe5134n jC6QzL1fdcaCTKwZiOBvynbWb2MnoMYw8L8JqcAmrhxSnHdWSK1af9qMrBHovhIdeA CXHwImEoMdfUgQbD/aWX75Dqo2en/2ItPGcMP3Nd4ZhOxHf6aqT5iPzZWft4ICILZ2 z1jB4G74ohJiCYV2QdjngiRX2bJJ9xUkHZr3f9IHfuBNnZQpDWd86IzaX40M0vd585 OSVDPVNyOPRrQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B1252689AD for ; Sun, 7 Dec 2025 13:17:54 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MAoZSrXaqwsD for ; Sun, 7 Dec 2025 13:17:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138674; bh=bgEroj+aCScHTZivGfjIOv3K5cK1f48IQ6mI9NbzcQs=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=cmdpKyAqnaWm/0XYNZ4osfgmbdWwDkBZhKhQoi18oEt3cDg1dPRJOI6/8phYimqtO rm984epJP/lUKyWXNNTSD62Gqv01SCpiGQoOnRH+qaubPMAa0KiBP6yfDgbFe5134n jC6QzL1fdcaCTKwZiOBvynbWb2MnoMYw8L8JqcAmrhxSnHdWSK1af9qMrBHovhIdeA CXHwImEoMdfUgQbD/aWX75Dqo2en/2ItPGcMP3Nd4ZhOxHf6aqT5iPzZWft4ICILZ2 z1jB4G74ohJiCYV2QdjngiRX2bJJ9xUkHZr3f9IHfuBNnZQpDWd86IzaX40M0vd585 OSVDPVNyOPRrQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A0D63688F6 for ; Sun, 7 Dec 2025 13:17:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138672; bh=bQQLIicLuG/Rn1YWMMUdA1dIV0oL9CoROR6ecW3BfbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sAp1UiUdKHbOJTPHtf1T+W855TFwCgtIBdnlEYOsUWk3pRutheAsbvj6hZoxK3eJi aqpRFLvlaVicZV37nvtb/87g2BirOptc/N2Kt0PjArgFLocY44lJXv8oocOU/9frJJ 1liSAkmA6F7MolftOEtk4J+VsP2PKdwUilPO3xfXf68+aMsaUolp2zfPugg9VP+P3P +1zqEg0A4W0ZitvHQ7J6ts45d0LXwl40Iez7wrjeMePR03qikNwI0Hv5ypNa+mJx8s 32bbHPu5hXIaka4trky2B4c+r6/n5zBKh8exzeCqfk/z6kYolk41QYsuu0sOnnDuyu A2cTTQSayGrjg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2ABC689A7; Sun, 7 Dec 2025 13:17:52 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id XJVoSNyzVk8d; Sun, 7 Dec 2025 13:17:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138667; bh=9YW5+1tGvrwaA/zseezveM48mGs7OFeWUvsHok33BG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vZydV2kbKRl+ZnMsvu3+x5lgqx4ZC58LG09QQJ1Ds5p5gQqaXY/2Aq/u337GneEPq p63taBe7nGWpAk3PYXRaxu6ubcVqgqrKhFdQUDmIddFIXYibY06xFcpy0tFAe+zgUD BZLy6TY1m4E1Cgz1gRt973GQIIqnooqxjxuNPw3XFKztvWSu2DU9w2L/SGBWgqljEy Y+fZsGb9IF7OB318s+RHguG4171r1YXsuEfLadttTZuyQACAvdWcnOiTi+JF/1rfwl EgLzK3l0GO+/xrhMrIExW3Fu1vUDP5pcvB9NR69OvdUa1gFV4bQWL00jmRreue367I AYocrHFkQ+66Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2DD0D5F6BF; Sun, 7 Dec 2025 13:17:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:13 -0700 Message-ID: <20251207201628.2882382-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RTSZJ2MC43NMG3OAL3VN3VJXWEGOWDL6 X-Message-ID-Hash: RTSZJ2MC43NMG3OAL3VN3VJXWEGOWDL6 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/22] expo: Refactor scene_send_key() to use a current object List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass The highlight_id needs to be considered for non-popup expos as well. As a first step, use the variable 'cur' for the current object, i.e. the one that is highlighted. Signed-off-by: Simon Glass --- boot/scene.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 1392d063c49..1bc4c9c25ac 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1082,30 +1082,28 @@ static void send_key_obj(struct scene *scn, struct scene_obj *obj, int key, int scene_send_key(struct scene *scn, int key, struct expo_action *event) { - struct scene_obj *obj; + struct scene_obj *cur, *obj; int ret; event->type = EXPOACT_NONE; /* - * In 'popup' mode, arrow keys move betwen objects, unless a menu is - * opened + * In 'popup' mode, arrow keys move betwen objects, unless a menu or + * textline is opened */ + cur = NULL; + if (scn->highlight_id) + cur = scene_obj_find(scn, scn->highlight_id, SCENEOBJT_NONE); if (scn->expo->popup) { - obj = NULL; - if (scn->highlight_id) { - obj = scene_obj_find(scn, scn->highlight_id, - SCENEOBJT_NONE); - } - if (!obj) + if (!cur) return 0; - if (!(obj->flags & SCENEOF_OPEN)) { - send_key_obj(scn, obj, key, event); + if (!(cur->flags & SCENEOF_OPEN)) { + send_key_obj(scn, cur, key, event); return 0; } - switch (obj->type) { + switch (cur->type) { case SCENEOBJT_NONE: case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: @@ -1114,7 +1112,7 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) case SCENEOBJT_MENU: { struct scene_obj_menu *menu; - menu = (struct scene_obj_menu *)obj, + menu = (struct scene_obj_menu *)cur, ret = scene_menu_send_key(scn, menu, key, event); if (ret) return log_msg_ret("key", ret); @@ -1123,7 +1121,7 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) case SCENEOBJT_TEXTLINE: { struct scene_obj_textline *tline; - tline = (struct scene_obj_textline *)obj, + tline = (struct scene_obj_textline *)cur, ret = scene_textline_send_key(scn, tline, key, event); if (ret) return log_msg_ret("key", ret);