Shortcuts: Fix return to wrong menu

Rockbox would go to a previously selected
menu instead of returning to the current one
when leaving the Shortcuts screen.

Change-Id: I3546e32def9124956cd9edc258e14db91d19fa22
This commit is contained in:
Christian Soffke 2022-11-03 18:28:16 +01:00 committed by William Wilgus
parent 8cbe5c95a9
commit 51c1e3ce7f
2 changed files with 15 additions and 3 deletions

View file

@ -458,9 +458,16 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected,
if (global_settings.shortcuts_replaces_qs ||
quick_screen_quick(action) == QUICKSCREEN_GOTO_SHORTCUTS_MENU)
{
int last_screen = global_status.last_screen;
global_status.last_screen = GO_TO_SHORTCUTMENU;
ret = do_shortcut_menu(NULL);
done = true;
int shortcut_ret = do_shortcut_menu(NULL);
if (shortcut_ret == GO_TO_PREVIOUS)
global_status.last_screen = last_screen;
else
{
ret = shortcut_ret;
done = true;
}
}
redraw_lists = true;
}

View file

@ -766,8 +766,13 @@ static int dirbrowse(void)
if (enter_shortcuts_menu && *tc.dirfilter < NUM_FILTER_MODES)
{
int last_screen = global_status.last_screen;
global_status.last_screen = GO_TO_SHORTCUTMENU;
return do_shortcut_menu(NULL);
int shortcut_ret = do_shortcut_menu(NULL);
if (shortcut_ret == GO_TO_PREVIOUS)
global_status.last_screen = last_screen;
else
return shortcut_ret;
}
restore = true;