Overlay: follow display offset/scale, avoid needless reloads

- Apply the display layout's scale and offset to the overlay itself instead
  of always centering it, so moving/resizing the display in Display Layout
  moves the overlay with the game inside it, and the portrait default
  (screen high up) is respected.
- Rescanning overlays (done whenever the display layout screen recreates its
  views, e.g. after closing the picker popup) no longer unloads the active
  overlay unless its definition changed.
- Re-picking the current overlay no longer posts GPU config change
  notifications, which caused an audio glitch with a game running behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QGBg32EFPsTXjAFu7dnTcz
This commit is contained in:
LunaMooandClaude Opus 5.5 committed 2026-10-22 14:09:51 +02:00
1 parent 3ce3973781
commit 519f282f99
4 files changed
+34 -13

No files matched your search

+5 -1
View File
@@ -370,7 +370,11 @@ void DisplayLayoutScreen::CreateViews() {
}
if (overlayIds.size() > 1) {
auto overlayChoice = leftColumn->Add(new PopupMultiChoiceDynamic(&config.sOverlay, gr->T("Overlay"), overlayNames, I18NCat::NONE, screenManager(), &overlayIds));
overlayChoice->OnChoice.Add([](UI::EventParams &) {
overlayChoice->OnChoice.Add([](UI::EventParams &e) {
// e.b is set if the value actually changed. Re-picking the current one shouldn't
// cause a reload, since that glitches the audio of a game running in the background.
if (!e.b)
return;
// The game rect may have moved, which matters for post shaders that run at output resolution.
NotifyPostChanges();
});