From e46bd61e2eccbf1fb5d1e12cc73d58be643bc5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 11 Oct 2026 17:28:11 +0200 Subject: [PATCH] When taking a screenshot, clear all notifications except achievements. --- Common/System/OSD.cpp | 13 +++++++++++++ Common/System/OSD.h | 2 ++ Core/Screenshot.cpp | 6 ++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Common/System/OSD.cpp b/Common/System/OSD.cpp index cb82a271fc..68d800ba57 100644 --- a/Common/System/OSD.cpp +++ b/Common/System/OSD.cpp @@ -345,3 +345,16 @@ void OnScreenDisplay::SetFlags(std::string_view id, OSDMessageFlags flags) { } } } + +void OnScreenDisplay::ClearNonAchievementEntries() { + std::lock_guard guard(mutex_); + for (auto iter = entries_.begin(); iter != entries_.end();) { + if (iter->type != OSDType::ACHIEVEMENT_UNLOCKED && + iter->type != OSDType::ACHIEVEMENT_PROGRESS && + iter->type != OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR) { + iter = entries_.erase(iter); + } else { + iter++; + } + } +} diff --git a/Common/System/OSD.h b/Common/System/OSD.h index 144850ba4b..5f1831fb2b 100644 --- a/Common/System/OSD.h +++ b/Common/System/OSD.h @@ -121,6 +121,8 @@ public: static float FadeinTime() { return 0.1f; } static float FadeoutTime() { return 0.25f; } + void ClearNonAchievementEntries(); + private: std::vector entries_; std::mutex mutex_; diff --git a/Core/Screenshot.cpp b/Core/Screenshot.cpp index be137ba9a6..6b2a68c8c7 100644 --- a/Core/Screenshot.cpp +++ b/Core/Screenshot.cpp @@ -524,8 +524,10 @@ void TakeUserScreenshot() { type = ScreenshotType::Output; } - // Close any earlier screenshot popups, so they don't end up in the next one. - g_OSD.CancelById("screenshot_link"); + // Close any active popups, so they don't end up in the screenshot. + // However people often want to take screenshots of achievement things, + // so keep those. + g_OSD.ClearNonAchievementEntries(); ScheduleScreenshot(filename, g_Config.bScreenshotsAsPNG ? ScreenshotFormat::PNG : ScreenshotFormat::JPG, type, -1, [filename](ScreenshotResult result) { if (result == ScreenshotResult::Success) {