diff --git a/es-app/src/views/gamelist/ISimpleGameListView.cpp b/es-app/src/views/gamelist/ISimpleGameListView.cpp index 436a0c648..6aca442c4 100644 --- a/es-app/src/views/gamelist/ISimpleGameListView.cpp +++ b/es-app/src/views/gamelist/ISimpleGameListView.cpp @@ -214,6 +214,18 @@ bool ISimpleGameListView::input(InputConfig* config, Input input) // Jump to the randomly selected game. if (mRandomGame) { NavigationSounds::getInstance()->playThemeNavigationSound(SCROLLSOUND); + // If there is already an mCursorStackHistory entry for the collection, then + // remove it so we don't get multiple entries. + std::vector listEntries = + mRandomGame->getSystem()->getRootFolder()->getChildrenListToDisplay(); + for (auto it = mCursorStackHistory.begin(); + it != mCursorStackHistory.end(); it++) { + if (std::find(listEntries.begin(), listEntries.end(), *it) != + listEntries.end()) { + mCursorStackHistory.erase(it); + break; + } + } setCursor(mRandomGame); updateHelpPrompts(); }