[CmdPal] Single settings window (#38069)

## Summary of the Pull Request

Make settings window single.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] **Closes:** https://github.com/zadjii-msft/PowerToys/issues/581

## Validation Steps Performed

Manual test.
- Open settings windows multiple times
- Activate minimized settings window
This commit is contained in:
Davide Giacometti
2025-03-21 20:58:47 +01:00
committed by GitHub
parent 4d7691a56f
commit 7368458a72
4 changed files with 26 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
xmlns:ui="using:CommunityToolkit.WinUI"
Title="SettingsWindow"
Activated="Window_Activated"
Closed="Window_Closed"
mc:Ignorable="d">
<Window.SystemBackdrop>
<MicaBackdrop />

View File

@@ -105,6 +105,11 @@ public sealed partial class SettingsWindow : Window,
WeakReferenceMessenger.Default.Send<WindowActivatedEventArgs>(args);
}
private void Window_Closed(object sender, WindowEventArgs args)
{
WeakReferenceMessenger.Default.Send<SettingsWindowClosedMessage>();
}
public void Receive(QuitMessage message)
{
// This might come in on a background thread