1
0
Fork 0
forked from len0rd/rockbox

root_menu.c fix recent regression for shortcuts add resume for plugins

recent changes broke shortcuts when they originated from the root menu

I mistakenly thought GO_TO_ROOT only happened at start and otherwise was
GO_TO_PREVIOUS

this commit also adds a few missing features for Start In Previous
to resume the last plugin running at shutdown

Additionally GO_TO_ROOT now overwrites the global last_screen so you can
return to the main menu on next startup

Change-Id: I86bf842616e25dc3d4f684ff9d476e6a5ba96b04
This commit is contained in:
William Wilgus 2021-11-07 01:56:49 -04:00
parent 13ac485625
commit 1d67f83c58
2 changed files with 40 additions and 7 deletions

View file

@ -374,6 +374,15 @@ int open_plugin_run(const char *key)
void open_plugin_cache_flush(void)
{
logf("OP *cache flush*");
/* start_in_screen == 0 is 'Previous Screen' it is actually
* defined as (GO_TO_PREVIOUS = -2) + 2 for *Legacy?* reasons AFAICT */
if (global_settings.start_in_screen == 0 &&
global_status.last_screen == GO_TO_PLUGIN &&
open_plugin_entry.lang_id > OPEN_PLUGIN_LANG_INVALID)
{
/* flush the last item as LANG_PREVIOUS_SCREEN if the user wants to resume */
open_plugin_entry.lang_id = LANG_PREVIOUS_SCREEN;
}
op_update_dat(&open_plugin_entry, true);
}