diff --git a/es-app/src/guis/GuiCollectionSystemsOptions.cpp b/es-app/src/guis/GuiCollectionSystemsOptions.cpp index d868343c6..b93673a87 100644 --- a/es-app/src/guis/GuiCollectionSystemsOptions.cpp +++ b/es-app/src/guis/GuiCollectionSystemsOptions.cpp @@ -89,6 +89,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) setNeedsSaving(); setNeedsReloading(); setNeedsCollectionsUpdate(); + setInvalidateCachedBackground(); } }); @@ -144,6 +145,7 @@ GuiCollectionSystemsOptions::GuiCollectionSystemsOptions(std::string title) setNeedsReloading(); setNeedsCollectionsUpdate(); setNeedsGoToGroupedCollections(); + setInvalidateCachedBackground(); } } }); diff --git a/es-app/src/guis/GuiSettings.cpp b/es-app/src/guis/GuiSettings.cpp index 8613031f7..49de168ff 100644 --- a/es-app/src/guis/GuiSettings.cpp +++ b/es-app/src/guis/GuiSettings.cpp @@ -137,6 +137,9 @@ void GuiSettings::save() if (state.getSystem()->isCollection() && state.getSystem()->getThemeFolder() != "custom-collections") { ViewController::getInstance()->goToStart(false); + ViewController::getInstance()->resetCamera(); + SDL_Delay(100); + mWindow->invalidateCachedBackground(); ViewController::getInstance()->goToSystem(SystemData::sSystemVector.front(), false); // We don't want to invalidate the cached background when there has been a collection // systen change as that may show a black screen in some circumstances. @@ -147,8 +150,12 @@ void GuiSettings::save() if (std::find(SystemData::sSystemVector.begin(), SystemData::sSystemVector.end(), state.getSystem()) == SystemData::sSystemVector.end()) { ViewController::getInstance()->goToStart(false); + ViewController::getInstance()->resetCamera(); + SDL_Delay(100); + mWindow->invalidateCachedBackground(); return; } + ViewController::getInstance()->resetCamera(); } if (mInvalidateCachedBackground) { diff --git a/es-app/src/views/ViewController.h b/es-app/src/views/ViewController.h index 64859aa6e..87ff2294d 100644 --- a/es-app/src/views/ViewController.h +++ b/es-app/src/views/ViewController.h @@ -65,6 +65,13 @@ public: bool isCameraMoving(); void cancelViewTransitions(); void stopScrolling(); + void resetCamera() + { + if (mCurrentView != nullptr) { + mCamera[3].x = -mCurrentView->getPosition().x; + mCamera[3].y = -mCurrentView->getPosition().y; + } + } // Basic video controls. void startViewVideos() override { mCurrentView->startViewVideos(); }