From d7019d672f651fecc004d5881241b6d68cdcc3e2 Mon Sep 17 00:00:00 2001 From: Sorgelig Date: Wed, 8 Jan 2025 15:01:39 +0800 Subject: [PATCH] menu: allow to close OSD before saving timeout. --- menu.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/menu.cpp b/menu.cpp index 689b610..d2fcd17 100644 --- a/menu.cpp +++ b/menu.cpp @@ -1301,8 +1301,8 @@ void HandleUI(void) --menusub; } while (menusub != 0 && (menumask & ((uint64_t)1 << menusub)) == 0); if (menusub == 0 && (menumask & 1) == 0) { //If the first menu entry is disabled... - while ((menumask & ((uint64_t)(~0) << (menusub + 1))) != 0) menusub++; - //Go to to last item + while ((menumask & ((uint64_t)(~0) << (menusub + 1))) != 0) menusub++; + //Go to to last item } } else { do @@ -2038,7 +2038,12 @@ void HandleUI(void) case MENU_GENERIC_SAVE_WAIT: menumask = 0; parentstate = menustate; - if (menu_save_timer && CheckTimer(menu_save_timer)) + if (menu) + { + menu_save_timer = 0; + menustate = MENU_NONE1; + } + else if (menu_save_timer && CheckTimer(menu_save_timer)) { menu_save_timer = 0; menustate = MENU_GENERIC_MAIN1;