Skip to content

Commit 5d9cdcd

Browse files
committed
(menu_iterate.C) Add back hack and add a FIXME note
1 parent 91a2ef6 commit 5d9cdcd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

menu/menu_iterate.c

+4
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ int menu_iterate(bool render_this_frame, enum menu_action action)
281281
BIT64_SET(menu->state, MENU_STATE_POP_STACK);
282282
break;
283283
case ITERATE_TYPE_DEFAULT:
284+
/* Crappy hack, needed for mouse controls to not be completely broken
285+
* in case we press back. NOTE/FIXME: we need to fix this entire mess,
286+
* mouse controls should not rely on a hack like this in order to work. */
287+
selection = max(min(selection, menu_list_get_size(menu_list)-1), 0);
284288
menu_entry_get(&entry, selection, NULL, false);
285289
ret = menu_entry_action(&entry, selection, (enum menu_action)action);
286290

0 commit comments

Comments
 (0)