From 2f854de9d0084ffe8508130bb621e02a4a9ac3f3 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 13 Jan 2025 12:54:18 +1000 Subject: [PATCH] Qt: Invalidate FSUI cover cache when cover changed --- src/core/fullscreen_ui.cpp | 9 +++++++-- src/duckstation-qt/gamelistwidget.cpp | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index 10f02e8fc..3d0610328 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -986,10 +986,15 @@ void FullscreenUI::Render() void FullscreenUI::InvalidateCoverCache() { - if (!IsInitialized()) + if (!GPUThread::IsFullscreenUIRequested()) return; - Host::RunOnCPUThread([]() { s_state.cover_image_map.clear(); }); + GPUThread::RunOnThread([]() { + if (!IsInitialized()) + return; + + s_state.cover_image_map.clear(); + }); } void FullscreenUI::ReturnToPreviousWindow() diff --git a/src/duckstation-qt/gamelistwidget.cpp b/src/duckstation-qt/gamelistwidget.cpp index aca21d9c1..ba00ee919 100644 --- a/src/duckstation-qt/gamelistwidget.cpp +++ b/src/duckstation-qt/gamelistwidget.cpp @@ -8,6 +8,7 @@ #include "qtutils.h" #include "settingswindow.h" +#include "core/fullscreen_ui.h" #include "core/game_list.h" #include "core/host.h" #include "core/settings.h" @@ -476,6 +477,7 @@ void GameListWidget::gridIntScale(int int_scale) void GameListWidget::refreshGridCovers() { m_model->refreshCovers(); + Host::RunOnCPUThread(&FullscreenUI::InvalidateCoverCache); } void GameListWidget::focusSearchWidget()