mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[Settings] Fix settings process not terminating on closing settings while minimized (#6626)
* Added code to set CoreWindow to visible on closing while minimized * Changed to environment.exit
This commit is contained in:
@@ -80,7 +80,7 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
|||||||
shellPage.Refresh();
|
shellPage.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the window is open, explicity force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384
|
// XAML Islands: If the window is open, explicity force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384
|
||||||
if (isOpen)
|
if (isOpen)
|
||||||
{
|
{
|
||||||
Show();
|
Show();
|
||||||
@@ -90,6 +90,13 @@ namespace Microsoft.PowerToys.Settings.UI.Runner
|
|||||||
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
isOpen = false;
|
isOpen = false;
|
||||||
|
|
||||||
|
// XAML Islands: If the window is closed while minimized, exit the process. Required to avoid process not terminating issue - https://github.com/microsoft/PowerToys/issues/4430
|
||||||
|
if (WindowState == WindowState.Minimized)
|
||||||
|
{
|
||||||
|
// Run Environment.Exit on a separate task to avoid performance impact
|
||||||
|
System.Threading.Tasks.Task.Run(() => { Environment.Exit(0); });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user