Skip to content

Commit 658f82e

Browse files
committed
menu_cbs_ok: key the dl-map dispatch on the entry label, not type
action_ok_dl_from_map looked the displaylist id up by matching the map's label enum against the callback 'type' argument. For every entry the map covers, 'type' is the menu_settings_type (MENU_SETTING_ACTION), never the MENU_ENUM_LABEL_* value stored in the map, so the scan always missed and fell through to ACTION_OK_DL_OPEN_ARCHIVE. Selecting Drivers, Load Core, Video Settings, etc. therefore opened the raw file browser (drive-letter list, path appended on each press) instead of the intended sub-list. The bind path already matched on the entry's canonical label; key the runtime dispatch on the same thing.
1 parent a419c18 commit 658f82e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

menu/cbs/menu_cbs_ok.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2041,8 +2041,15 @@ static int action_ok_dl_from_map(const char *path,
20412041
const char *label, unsigned type, size_t idx, size_t entry_idx)
20422042
{
20432043
size_t i;
2044+
/* The ok callback signature carries no enum_idx; the previous
2045+
* lookup keyed on 'type', but for these entries 'type' is the
2046+
* menu_settings_type (MENU_SETTING_ACTION), never the label enum,
2047+
* so every row missed and fell through to the archive/file browser.
2048+
* Key on the entry's canonical label instead, which is what the
2049+
* bind path matched on. */
20442050
for (i = 0; i < ARRAY_SIZE(ok_dl_map); i++)
2045-
if (ok_dl_map[i].enum_idx == (uint32_t)type)
2051+
if (string_is_equal(label,
2052+
msg_hash_to_str((enum msg_hash_enums)ok_dl_map[i].enum_idx)))
20462053
return generic_action_ok_displaylist_push(path, NULL,
20472054
label, type, idx, entry_idx,
20482055
(unsigned)ok_dl_map[i].dl_id);

0 commit comments

Comments
 (0)