diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 11dc56d0..e559505e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - name: Update packages run: | sudo -n apt-get update - sudo -n apt-get upgrade -y git + sudo -n apt-get upgrade -y git maven - name: Silence all git safe directory warnings run: git config --system --add safe.directory '*' diff --git a/projects/uMenu/include/ul/menu/ui/ui_MainMenuLayout.hpp b/projects/uMenu/include/ul/menu/ui/ui_MainMenuLayout.hpp index 739113d7..276f3625 100644 --- a/projects/uMenu/include/ul/menu/ui/ui_MainMenuLayout.hpp +++ b/projects/uMenu/include/ul/menu/ui/ui_MainMenuLayout.hpp @@ -17,6 +17,8 @@ namespace ul::menu::ui { // TODONEW: config in theme? static constexpr u8 SuspendedScreenAlphaIncrement = 6; + static constexpr s64 MessagesWaitTimeoutSeconds = 1; + private: enum class SuspendedImageMode { ShowingAfterStart = 0, @@ -53,7 +55,7 @@ namespace ul::menu::ui { QuickMenu::Ref quick_menu; InputBar::Ref input_bar; std::chrono::steady_clock::time_point startup_tp; - bool launch_fail_warn_shown; + bool start_time_elapsed; u8 min_alpha; u8 target_alpha; SuspendedImageMode mode; diff --git a/projects/uMenu/source/ul/menu/ui/ui_MainMenuLayout.cpp b/projects/uMenu/source/ul/menu/ui/ui_MainMenuLayout.cpp index ec8154f0..37abd9cb 100644 --- a/projects/uMenu/source/ul/menu/ui/ui_MainMenuLayout.cpp +++ b/projects/uMenu/source/ul/menu/ui/ui_MainMenuLayout.cpp @@ -447,7 +447,7 @@ namespace ul::menu::ui { } } - MainMenuLayout::MainMenuLayout(const u8 *captured_screen_buf, const u8 min_alpha) : last_has_connection(false), last_battery_lvl(0), last_is_charging(false), cur_folder_path(""), launch_fail_warn_shown(false), min_alpha(min_alpha), target_alpha(0), mode(SuspendedImageMode::ShowingAfterStart), suspended_screen_alpha(0xFF) { + MainMenuLayout::MainMenuLayout(const u8 *captured_screen_buf, const u8 min_alpha) : last_has_connection(false), last_battery_lvl(0), last_is_charging(false), cur_folder_path(""), start_time_elapsed(false), min_alpha(min_alpha), target_alpha(0), mode(SuspendedImageMode::ShowingAfterStart), suspended_screen_alpha(0xFF) { // TODONEW: like nxlink but for sending themes and quickly being able to test them? if(captured_screen_buf != nullptr) { @@ -667,9 +667,15 @@ namespace ul::menu::ui { this->battery_icon->SetImage(TryFindImage(g_Theme, battery_img)); } - const auto now_tp = std::chrono::steady_clock::now(); - // Wait a bit before handling sent messages - if(std::chrono::duration_cast(now_tp - this->startup_tp).count() >= 1000) { + if(!this->start_time_elapsed) { + const auto now_tp = std::chrono::steady_clock::now(); + // Wait a bit before handling sent messages + if(std::chrono::duration_cast(now_tp - this->startup_tp).count() >= MessagesWaitTimeoutSeconds) { + this->start_time_elapsed = true; + } + } + + if(this->start_time_elapsed) { if(g_MenuApplication->GetLaunchFailed()) { g_MenuApplication->CreateShowDialog(GetLanguageString("app_launch"), GetLanguageString("app_unexpected_error"), { GetLanguageString("ok") }, true); }