From c013122520050614a6ffdd5ca8ec478e82323683 Mon Sep 17 00:00:00 2001 From: Kai Tao <69313318+vanzue@users.noreply.github.com> Date: Wed, 25 Feb 2026 21:50:42 +0800 Subject: [PATCH] Settings: Fix settings process shutdown when closing secondary windows (#45787) ## Summary of the Pull Request ## PR Checklist - [ ] Closes: #45549 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed When no window alive, the settings exe should also be gone --- src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs index df8b490bd6..151f8f3bdc 100644 --- a/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs +++ b/src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs @@ -356,6 +356,7 @@ namespace Microsoft.PowerToys.Settings.UI scoobeWindow.Closed += (_, _) => { scoobeWindow = null; + settingsWindow?.CloseHiddenWindow(); }; scoobeWindow.Activate(); @@ -377,6 +378,7 @@ namespace Microsoft.PowerToys.Settings.UI oobeWindow.Closed += (_, _) => { oobeWindow = null; + settingsWindow?.CloseHiddenWindow(); }; oobeWindow.Activate(); @@ -396,6 +398,7 @@ namespace Microsoft.PowerToys.Settings.UI shortcutConflictWindow.Closed += (_, _) => { shortcutConflictWindow = null; + settingsWindow?.CloseHiddenWindow(); }; shortcutConflictWindow.Activate();