diff --git a/es-app/src/guis/GuiAlternativeEmulators.cpp b/es-app/src/guis/GuiAlternativeEmulators.cpp index f2ff420e6..5dec08edb 100644 --- a/es-app/src/guis/GuiAlternativeEmulators.cpp +++ b/es-app/src/guis/GuiAlternativeEmulators.cpp @@ -220,7 +220,14 @@ void GuiAlternativeEmulators::selectorWindow(SystemData* system) auto menuPos = s->getMenuPosition(); s->setMenuPosition(glm::vec3 {(s->getSize().x - menuSize.x) / 2.0f, menuPos.y, menuPos.z}); - s->refreshList(); + + // Hack to properly update the window and set the scroll indicators. Why this is required + // is currently a mystery. + auto list = s->getMenu().getList(); + list->update(1); + int cursor {list->getCursorId()}; + list->setCursor(list->getFirst()); + list->moveCursor(cursor); mWindow->pushGui(s); } diff --git a/es-app/src/guis/GuiSettings.h b/es-app/src/guis/GuiSettings.h index 002dbd251..9e647ff2c 100644 --- a/es-app/src/guis/GuiSettings.h +++ b/es-app/src/guis/GuiSettings.h @@ -38,11 +38,11 @@ public: bool isPassword = false); void addSaveFunc(const std::function& func) { mSaveFuncs.push_back(func); } + MenuComponent& getMenu() { return mMenu; } glm::vec2 getMenuSize() { return mMenu.getSize(); } void setMenuSize(glm::vec2 size) { mMenu.setSize(size); } glm::vec3 getMenuPosition() { return mMenu.getPosition(); } void setMenuPosition(glm::vec3 position) { mMenu.setPosition(glm::round(position)); } - void refreshList() { mMenu.getList()->onSizeChanged(); } void setNeedsSaving(bool state = true) { mNeedsSaving = state; } void setNeedsReloadHelpPrompts() { mNeedsReloadHelpPrompts = true; }