From 1d67f83c587cce30a9afa10f966cc04a86adb87b Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Sun, 7 Nov 2021 01:56:49 -0400 Subject: 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 --- apps/open_plugin.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apps/open_plugin.c') diff --git a/apps/open_plugin.c b/apps/open_plugin.c index d16502ecbe..f7f55d58cd 100644 --- a/apps/open_plugin.c +++ b/apps/open_plugin.c @@ -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); } -- cgit v1.2.3