Skip to content

Commit

Permalink
[PT Settings] Crash on restart with OOBE window opened fix (#10005)
Browse files Browse the repository at this point in the history
  • Loading branch information
SeraphimaZykova committed Mar 3, 2021
1 parent 571e7f2 commit de7f8c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/settings-ui/PowerToys.Settings/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
ShellPage.SetRestartAdminSndMessageCallback(msg =>
{
Program.GetTwoWayIPCManager().Send(msg);
isOpen = false;
System.Windows.Application.Current.Shutdown(); // close application
});

Expand Down Expand Up @@ -117,7 +118,13 @@ private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
// XAML Islands: If the window is open, explicitly force it to be shown to solve the blank dialog issue https://github.com/microsoft/PowerToys/issues/3384
if (isOpen)
{
Show();
try
{
Show();
}
catch (InvalidOperationException)
{
}
}
}

Expand Down

0 comments on commit de7f8c4

Please sign in to comment.