From 6a1b4075b95cb99277ac764093388f0fd7f511bb Mon Sep 17 00:00:00 2001 From: Ednunp <29843396+Ednunp@users.noreply.github.com> Date: Mon, 27 Jul 2026 12:26:28 +0100 Subject: [PATCH] Fix: service-profile dialog must open with foreground focus (NVDA) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ed clicked Yes on the weak-service-password nag and the service-settings dialog opened BEHIND everything — he had to Alt-Tab to find it, and the nested change-password dialog with it. Cause: ConfigureServiceProfile opened ServiceProfileDialog with a plain ShowDialog(this), which does NOT surface the dialog when the main window is minimised in the tray. The app already has the fix — ForegroundDialog (the 1x1-owner + foreground-lock dance the mic/Realtek/About warnings use) — but this dialog bypassed it, and it's now reachable from a nag that fires while minimised. Now routed through ForegroundDialog, so it opens front-and-centre with focus wherever RemSound is sitting. The nested "Set service profile password" dialog already uses ForegroundDialog, so it inherits the foreground once its parent is up (that was Ed's second complaint — a cascade from the unfocused parent, not a separate bug). Gate 71/71 + 7 relay tests. Co-Authored-By: Claude Fable 5 --- src/RemSound.App/MainForm.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/RemSound.App/MainForm.cs b/src/RemSound.App/MainForm.cs index d030d2d..a90523b 100644 --- a/src/RemSound.App/MainForm.cs +++ b/src/RemSound.App/MainForm.cs @@ -2437,7 +2437,11 @@ public sealed partial class MainForm : Form current ??= Profile.NewBlank(); using var dlg = new ServiceProfileDialog(current, ServiceStore.LoadLoggingEnabled()); - if (dlg.ShowDialog(this) != DialogResult.OK) return; + // Via ForegroundDialog so it opens front-and-centre with focus even when the main window is + // minimised in the tray — this dialog is now reachable from the weak-service-password nag, + // which can fire while RemSound is minimised (Ed, 2026-07-27: "clicked Yes but had to Alt-Tab + // to find it"). The nested "Set password" dialog inherits the foreground once its parent is up. + if (ForegroundDialog.Show(owner => dlg.ShowDialog(owner)) != DialogResult.OK) return; try { ServiceStore.SaveProfile(dlg.Result);