diff --git a/es-app/src/views/SystemView.cpp b/es-app/src/views/SystemView.cpp index ac4138bad..790e249b1 100644 --- a/es-app/src/views/SystemView.cpp +++ b/es-app/src/views/SystemView.cpp @@ -25,6 +25,7 @@ SystemView::SystemView() : mRenderer {Renderer::getInstance()} , mPrimary {nullptr} , mPrimaryType {PrimaryType::CAROUSEL} + , mLastCursor {-1} , mCamOffset {0.0f} , mFadeOpacity {0.0f} , mPreviousScrollVelocity {0} @@ -137,8 +138,10 @@ void SystemView::update(int deltaTime) mPrimary->update(deltaTime); - for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents) - video->update(deltaTime); + for (auto& video : mSystemElements[mPrimary->getCursor()].videoComponents) { + if (!isScrolling()) + video->update(deltaTime); + } for (auto& anim : mSystemElements[mPrimary->getCursor()].lottieAnimComponents) anim->update(deltaTime); @@ -213,6 +216,12 @@ void SystemView::onCursorChanged(const CursorState& state) { int cursor {mPrimary->getCursor()}; + // Avoid double updates. + if (cursor == mLastCursor) + return; + + mLastCursor = cursor; + for (auto& selector : mSystemElements[cursor].gameSelectors) { if (selector->getGameSelection() == GameSelectorComponent::GameSelection::RANDOM) selector->setNeedsRefresh(); diff --git a/es-app/src/views/SystemView.h b/es-app/src/views/SystemView.h index 73e5746be..2da756f7b 100644 --- a/es-app/src/views/SystemView.h +++ b/es-app/src/views/SystemView.h @@ -122,6 +122,7 @@ private: std::vector mSystemElements; PrimaryComponent* mPrimary; PrimaryType mPrimaryType; + int mLastCursor; // Dummy entry to keep the default SVG rating images in the texture cache so they don't // need to be re-rasterized for each gamelist that is loaded. diff --git a/es-core/src/components/primary/CarouselComponent.h b/es-core/src/components/primary/CarouselComponent.h index 92fdc7a8e..a21b292f4 100644 --- a/es-core/src/components/primary/CarouselComponent.h +++ b/es-core/src/components/primary/CarouselComponent.h @@ -491,8 +491,11 @@ template bool CarouselComponent::input(InputConfig* config, Inpu } else { if (config->isMappedLike("up", input) || config->isMappedLike("down", input) || - config->isMappedLike("left", input) || config->isMappedLike("right", input)) + config->isMappedLike("left", input) || config->isMappedLike("right", input)) { + if (isScrolling()) + onCursorChanged(CursorState::CURSOR_STOPPED); List::listInput(0); + } } } diff --git a/es-core/src/components/primary/TextListComponent.h b/es-core/src/components/primary/TextListComponent.h index 2b0221ef8..910dcef56 100644 --- a/es-core/src/components/primary/TextListComponent.h +++ b/es-core/src/components/primary/TextListComponent.h @@ -268,10 +268,14 @@ template bool TextListComponent::input(InputConfig* config, Inpu config->isMappedLike("rightshoulder", input) || config->isMappedLike("lefttrigger", input) || config->isMappedLike("righttrigger", input)) { - if constexpr (std::is_same_v) + if constexpr (std::is_same_v) { + if (isScrolling()) + onCursorChanged(CursorState::CURSOR_STOPPED); List::listInput(0); - else + } + else { List::stopScrolling(); + } } } }