From fc71dcf2766330a5fc6764d3e98c3be63b63c6ac Mon Sep 17 00:00:00 2001 From: gugueU Date: Wed, 29 Oct 2025 11:10:30 +0100 Subject: [PATCH 1/2] fix(feat): fix go to game from search and gameclip --- RELEASE-NOTES.md | 1 + .../frontend/es-app/src/views/ViewController.cpp | 11 ++++++++++- .../es-app/src/views/container/TextGamelist.cpp | 2 +- .../src/views/gamelist/DetailedGameListView.cpp | 12 +++++++++++- .../es-app/src/views/gamelist/ISimpleGameListView.h | 2 ++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 215903b919..ba36074a05 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -120,6 +120,7 @@ as release notes for end user on a Recalbox upgrade. - Fix webmanager on Raspberry Pi 3 - Remove the keyboard layout option for pi5 as the option is not applied - Fix rg353m v2 support +- Fix go to game from search and gameclip ### Bumps - Bump retroarch to 1.19.1 diff --git a/projects/frontend/es-app/src/views/ViewController.cpp b/projects/frontend/es-app/src/views/ViewController.cpp index ab9fc43eb8..f920211f87 100755 --- a/projects/frontend/es-app/src/views/ViewController.cpp +++ b/projects/frontend/es-app/src/views/ViewController.cpp @@ -180,7 +180,16 @@ void ViewController::selectGamelistAndCursor(FileData *file) goToGameList(&system); ISimpleGameListView* view = GetOrCreateGamelistView(&system); view->Gamelist().RebuildFolderStack(file); - view->Gamelist().SetSelectedGame(file); + if (view->Gamelist().LookupGameIndex(file) == -1) + { + view->populateList(*file->Parent()); + view->BuildList(file); + } + else + { + view->Gamelist().SetSelectedGame(file); + } + } SystemData* ViewController::goToNextGameList() diff --git a/projects/frontend/es-app/src/views/container/TextGamelist.cpp b/projects/frontend/es-app/src/views/container/TextGamelist.cpp index 0ae9904343..68f2a71398 100644 --- a/projects/frontend/es-app/src/views/container/TextGamelist.cpp +++ b/projects/frontend/es-app/src/views/container/TextGamelist.cpp @@ -74,7 +74,7 @@ IGamelistContainer& TextGamelist::RebuildFolderStack(FileData* from) { FolderData* folder = from->Parent(); mFolderStack.Clear(); - while((folder != nullptr) && !folder->IsTopMostRoot()) + while((folder != nullptr) && !folder->IsRoot()) { mFolderStack.Push(folder); folder = folder->Parent(); diff --git a/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp b/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp index 05a65a015a..fe937f081c 100755 --- a/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp +++ b/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp @@ -792,6 +792,12 @@ void DetailedGameListView::populateList(const FolderData& folder) void DetailedGameListView::BuildList(FileData* target) { + bool isOneGameOneRomMode = !IsFavoriteSystem() && RecalboxConf::Instance().GetOneGameOneRom(); + if (isOneGameOneRomMode && target != nullptr) + { + mLastCursorItem = target; + } + // Reorder favorites bool hasTopFavorites = false; if (!IsFavoriteSystem() && RecalboxConf::Instance().GetFavoritesFirst()) @@ -838,7 +844,6 @@ void DetailedGameListView::BuildList(FileData* target) Gamelist().ClearGames(mGamelist.Count()); FileData* previous = nullptr; HeaderData* lastHeader = nullptr; - bool isOneGameOneRomMode = !IsFavoriteSystem() && RecalboxConf::Instance().GetOneGameOneRom(); for (FileData* item : mGamelist) { String name = item->Name(); @@ -865,6 +870,11 @@ void DetailedGameListView::BuildList(FileData* target) if (isOneGameOneRomMode && (oGoR = m1G1R.try_get(item)) != nullptr) { OneGameOneRom& hierarchy = **oGoR; + + // usefull for go to game from search or gameclip + if (mLastCursorItem != nullptr && hierarchy.mChildren.Contains(mLastCursorItem)) + hierarchy.mFolded = false; + Gamelist().AddGames(item, GetRawDisplayName(*item), hierarchy.mFolded ? GameType::ParentGameFolded : GameType::ParentGameUnfolded, colorIndexOffset + (item->IsFolder() ? FolderColor : GameColor)); diff --git a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h index 6a5c65f6d2..597decee04 100644 --- a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h +++ b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h @@ -86,6 +86,8 @@ class ISimpleGameListView : public Gui virtual void populateList(const FolderData& folder) = 0; + virtual void BuildList(FileData* target) = 0; + virtual void refreshList() = 0; /*! -- GitLab From c4a18f3c6e5ce0f0f4786fc8920fcd105303bf46 Mon Sep 17 00:00:00 2001 From: gugueU Date: Wed, 29 Oct 2025 13:49:11 +0100 Subject: [PATCH 2/2] fix(feat): fix go to game from search and gameclip --- projects/frontend/es-app/src/views/ViewController.cpp | 3 +-- .../es-app/src/views/gamelist/ArcadeGameListView.cpp | 6 +++--- .../es-app/src/views/gamelist/ArcadeGameListView.h | 3 ++- .../es-app/src/views/gamelist/DetailedGameListView.cpp | 10 +++++----- .../es-app/src/views/gamelist/DetailedGameListView.h | 5 +++-- .../es-app/src/views/gamelist/ISimpleGameListView.cpp | 4 ++-- .../es-app/src/views/gamelist/ISimpleGameListView.h | 6 ++---- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/projects/frontend/es-app/src/views/ViewController.cpp b/projects/frontend/es-app/src/views/ViewController.cpp index f920211f87..986289a5fc 100755 --- a/projects/frontend/es-app/src/views/ViewController.cpp +++ b/projects/frontend/es-app/src/views/ViewController.cpp @@ -182,8 +182,7 @@ void ViewController::selectGamelistAndCursor(FileData *file) view->Gamelist().RebuildFolderStack(file); if (view->Gamelist().LookupGameIndex(file) == -1) { - view->populateList(*file->Parent()); - view->BuildList(file); + view->populateList(*file->Parent(), file); } else { diff --git a/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.cpp b/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.cpp index ed38eba3da..5e6f8a32b2 100644 --- a/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.cpp +++ b/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.cpp @@ -12,7 +12,7 @@ ArcadeGameListView::ArcadeGameListView(WindowManager& window, SystemManager& sys { } -void ArcadeGameListView::populateList(const FolderData& folder) +void ArcadeGameListView::populateList(const FolderData& folder, FileData* target = nullptr) { mPopulatedFolder = &folder; @@ -33,7 +33,7 @@ void ArcadeGameListView::populateList(const FolderData& folder) if (!Gamelist().IsInRootFolder()) { FolderData* current = Gamelist().GetCurrentFolder(); - populateList(*Gamelist().ExitFolder()); + populateList(*Gamelist().ExitFolder(), target); Gamelist().SetSelectedGame(current); return; } @@ -57,7 +57,7 @@ void ArcadeGameListView::BuildList() // Empty gamelist might be caused by the lack of database, so fallback to normal view if (mGameList.empty()) { - DetailedGameListView::populateList(*mPopulatedFolder); + DetailedGameListView::populateList(*mPopulatedFolder, nullptr); return; } diff --git a/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.h b/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.h index 476b6baa16..30bec6d940 100644 --- a/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.h +++ b/projects/frontend/es-app/src/views/gamelist/ArcadeGameListView.h @@ -108,8 +108,9 @@ class ArcadeGameListView : public DetailedGameListView /*! * @brief Rebuild the gamelist - regenerate internal structure * @param folder + * @param target */ - void populateList(const FolderData& folder) final; + void populateList(const FolderData& folder, FileData* target) final; /*! * @brief Rebuild the gamelist using internal structures diff --git a/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp b/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp index fe937f081c..39e520a77d 100755 --- a/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp +++ b/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.cpp @@ -736,7 +736,7 @@ String DetailedGameListView::GetRawDisplayName(const FileData& game) return mConf.GetDisplayByFileName() ? game.Metadata().RomFileOnly().FilenameWithoutExtension() : game.Name(); } -void DetailedGameListView::populateList(const FolderData& folder) +void DetailedGameListView::populateList(const FolderData& folder, FileData* target) { mPopulatedFolder = &folder; Gamelist().ClearGames(); @@ -759,7 +759,7 @@ void DetailedGameListView::populateList(const FolderData& folder) if (!Gamelist().IsInRootFolder()) { FolderData* current = Gamelist().GetCurrentFolder(); - populateList(*Gamelist().ExitFolder()); + populateList(*Gamelist().ExitFolder(), target); Gamelist().SetSelectedGame(current); return; } @@ -787,7 +787,7 @@ void DetailedGameListView::populateList(const FolderData& folder) if (isOneGameOneRomMode) GeneratePreferredOneGameOneRoms(mGamelist); - BuildList(nullptr); + BuildList(target); } void DetailedGameListView::BuildList(FileData* target) @@ -1245,7 +1245,7 @@ void DetailedGameListView::ChangeSort(bool next) // Refresh FileData* item = Gamelist().GetSelectedGame(); - populateList(*mPopulatedFolder); + populateList(*mPopulatedFolder, nullptr); Gamelist().SetSelectedGame(item); // Notify @@ -1277,7 +1277,7 @@ void DetailedGameListView::ReturnedFromGame(FileData* game) { // Refresh to reflect time played/last played FileData* item = Gamelist().GetSelectedGame(); - populateList(*mPopulatedFolder); + populateList(*mPopulatedFolder, nullptr); Gamelist().SetSelectedGame(item); break; } diff --git a/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.h b/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.h index 6681814deb..558401bc08 100644 --- a/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.h +++ b/projects/frontend/es-app/src/views/gamelist/DetailedGameListView.h @@ -90,8 +90,9 @@ class DetailedGameListView : public ISimpleGameListView /*! * @brief Rebuild the current gamelist according to the give folder * @param folder Game folder + * @param target */ - void populateList(const FolderData& folder) override; + void populateList(const FolderData& folder, FileData* target) override; /*! * @brief Refresh the UI list w/ what have been built in populateList @@ -105,7 +106,7 @@ class DetailedGameListView : public ISimpleGameListView FileData* currentItem = Gamelist().GetSelectedGame(); int index = Gamelist().GetSelectedGameIndex(); // Refresh list - populateList(*mPopulatedFolder); + populateList(*mPopulatedFolder, nullptr); // Try to set the old data. If it does not exist anymore, ajust index if (!Gamelist().SetSelectedGame(currentItem)) diff --git a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp index 50a7f48da8..2d15336553 100755 --- a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -94,7 +94,7 @@ bool ISimpleGameListView::ProcessInput(const InputCompactEvent& event) // Back to parent folder FolderData* current = Gamelist().GetCurrentFolder(); mLastPositionInFolder[current] = cursor; - populateList(*Gamelist().ExitFolder()); + populateList(*Gamelist().ExitFolder(), nullptr); Gamelist().SetSelectedGame(current); } else if (!hideSystemView) @@ -273,7 +273,7 @@ void ISimpleGameListView::OnFolderValidated(IGamelistContainer& caller, FolderDa if (folder->HasChildren()) { Gamelist().EnterFolder(folder); - populateList(*folder); + populateList(*folder, nullptr); FileData** lastPosition = mLastPositionInFolder.try_get(folder); if (lastPosition != nullptr) Gamelist().SetSelectedGame(*lastPosition); else Gamelist().SetSelectedGameIndex(0); diff --git a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h index 597decee04..ddd0a42f12 100644 --- a/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h +++ b/projects/frontend/es-app/src/views/gamelist/ISimpleGameListView.h @@ -84,9 +84,7 @@ class ISimpleGameListView : public Gui virtual void DoUpdateGameInformation(bool update) = 0; - virtual void populateList(const FolderData& folder) = 0; - - virtual void BuildList(FileData* target) = 0; + virtual void populateList(const FolderData& folder, FileData* target) = 0; virtual void refreshList() = 0; @@ -110,7 +108,7 @@ class ISimpleGameListView : public Gui { Initialize(); SwitchToTheme(mSystem.Theme(), false, nullptr); - populateList(mSystem.MasterRoot()); + populateList(mSystem.MasterRoot(), nullptr); } /*! -- GitLab