From a64d4dce7ae409ef2d610fb98ae262f60de10feb Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Mon, 19 May 2025 16:07:24 +0100 Subject: [PATCH] remove ns event from games menu (see below). turns out that the event is auto cleared when waited. this meant that if sphaira handled the event before qlaunch got chance to handle it, then qlaunch won't update when app records changed. this can result in a gamecard not being mounted, deleted games still apearing, installed games not being displayed etc... --- sphaira/include/ui/menus/game_menu.hpp | 1 - sphaira/source/ui/menus/game_menu.cpp | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/sphaira/include/ui/menus/game_menu.hpp b/sphaira/include/ui/menus/game_menu.hpp index 8bc5ba8..89301d1 100644 --- a/sphaira/include/ui/menus/game_menu.hpp +++ b/sphaira/include/ui/menus/game_menu.hpp @@ -138,7 +138,6 @@ private: s64 m_index{}; // where i am in the array s64 m_selected_count{}; std::unique_ptr m_list{}; - Event m_event{}; bool m_is_reversed{}; bool m_dirty{}; diff --git a/sphaira/source/ui/menus/game_menu.cpp b/sphaira/source/ui/menus/game_menu.cpp index c4d6294..fe7c0c3 100644 --- a/sphaira/source/ui/menus/game_menu.cpp +++ b/sphaira/source/ui/menus/game_menu.cpp @@ -1060,7 +1060,6 @@ Menu::Menu() : grid::Menu{"Games"_i18n} { OnLayoutChange(); nsInitialize(); - nsGetApplicationRecordUpdateSystemEvent(&m_event); es::Initialize(); for (auto& e : ncm_entries) { @@ -1079,7 +1078,6 @@ Menu::~Menu() { } FreeEntries(); - eventClose(&m_event); nsExit(); es::Exit(); @@ -1088,11 +1086,6 @@ Menu::~Menu() { } void Menu::Update(Controller* controller, TouchInfo* touch) { - if (R_SUCCEEDED(eventWait(&m_event, 0))) { - log_write("got ns event\n"); - m_dirty = true; - } - if (m_dirty) { App::Notify("Updating application record list"); SortAndFindLastFile(true); @@ -1182,10 +1175,6 @@ void Menu::ScanHomebrew() { FreeEntries(); m_entries.reserve(ENTRY_CHUNK_COUNT); - // wait on event in order to clear it as this event will trigger when - // an application is launched, causing a double list. - eventWait(&m_event, 0); - std::vector record_list(ENTRY_CHUNK_COUNT); s32 offset{}; while (true) {