Skip to content

Commit

Permalink
[FZ Editor] Hack to workaround crash (#9398)
Browse files Browse the repository at this point in the history
  • Loading branch information
enricogior committed Feb 1, 2021
1 parent 8556ccb commit 3d35aed
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/modules/fancyzones/editor/FancyZonesEditor/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,18 @@ private void NewLayoutDialog_PrimaryButtonClick(ModernWpf.Controls.ContentDialog

selectedLayoutModel.InitTemplateZones();

try
{
Hide();
}
catch
{
// See https://github.com/microsoft/PowerToys/issues/9396
Hide();
}

App.Overlay.CurrentDataContext = selectedLayoutModel;
var mainEditor = App.Overlay;
Hide();
mainEditor.OpenEditor(selectedLayoutModel);
App.Overlay.OpenEditor(selectedLayoutModel);
}

// This is required to fix a WPF rendering bug when using custom chrome
Expand Down

0 comments on commit 3d35aed

Please sign in to comment.