diff options
author | Christian Soffke <christian.soffke@gmail.com> | 2022-11-03 18:28:16 +0100 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2022-11-04 16:09:07 -0400 |
commit | 51c1e3ce7fa2874f2b1afd0788ff7d2beba6a96e (patch) | |
tree | ee0b1b65410627997b5e457bae5c4498cfe23365 | |
parent | 8cbe5c95a96a2b096b59db66b11fa1897dd5e720 (diff) | |
download | rockbox-51c1e3ce7fa2874f2b1afd0788ff7d2beba6a96e.tar.gz rockbox-51c1e3ce7fa2874f2b1afd0788ff7d2beba6a96e.zip |
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
-rw-r--r-- | apps/menu.c | 11 | ||||
-rw-r--r-- | apps/tree.c | 7 |
2 files changed, 15 insertions, 3 deletions
diff --git a/apps/menu.c b/apps/menu.c index c86ada1986..d8d1b6b081 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -458,9 +458,16 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
458 | if (global_settings.shortcuts_replaces_qs || | 458 | if (global_settings.shortcuts_replaces_qs || |
459 | quick_screen_quick(action) == QUICKSCREEN_GOTO_SHORTCUTS_MENU) | 459 | quick_screen_quick(action) == QUICKSCREEN_GOTO_SHORTCUTS_MENU) |
460 | { | 460 | { |
461 | int last_screen = global_status.last_screen; | ||
461 | global_status.last_screen = GO_TO_SHORTCUTMENU; | 462 | global_status.last_screen = GO_TO_SHORTCUTMENU; |
462 | ret = do_shortcut_menu(NULL); | 463 | int shortcut_ret = do_shortcut_menu(NULL); |
463 | done = true; | 464 | if (shortcut_ret == GO_TO_PREVIOUS) |
465 | global_status.last_screen = last_screen; | ||
466 | else | ||
467 | { | ||
468 | ret = shortcut_ret; | ||
469 | done = true; | ||
470 | } | ||
464 | } | 471 | } |
465 | redraw_lists = true; | 472 | redraw_lists = true; |
466 | } | 473 | } |
diff --git a/apps/tree.c b/apps/tree.c index cb7c033b6f..70f2704fae 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -766,8 +766,13 @@ static int dirbrowse(void) | |||
766 | 766 | ||
767 | if (enter_shortcuts_menu && *tc.dirfilter < NUM_FILTER_MODES) | 767 | if (enter_shortcuts_menu && *tc.dirfilter < NUM_FILTER_MODES) |
768 | { | 768 | { |
769 | int last_screen = global_status.last_screen; | ||
769 | global_status.last_screen = GO_TO_SHORTCUTMENU; | 770 | global_status.last_screen = GO_TO_SHORTCUTMENU; |
770 | return do_shortcut_menu(NULL); | 771 | int shortcut_ret = do_shortcut_menu(NULL); |
772 | if (shortcut_ret == GO_TO_PREVIOUS) | ||
773 | global_status.last_screen = last_screen; | ||
774 | else | ||
775 | return shortcut_ret; | ||
771 | } | 776 | } |
772 | 777 | ||
773 | restore = true; | 778 | restore = true; |