From 0941f655eba3570e5f9c04dbca82f76ad3add25e Mon Sep 17 00:00:00 2001 From: John Lewin Date: Wed, 3 Oct 2018 11:10:46 -0700 Subject: [PATCH] Handle reentrant calls to ShowSystemWindow - Issue MatterHackers/MCCentral#4227 Load filament wizard isn't switching panels correctly --- MatterControl.Winforms/WinformsSingleWindowProvider.cs | 3 ++- MatterControlLib/CustomWidgets/SingleWindowProvider.cs | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/MatterControl.Winforms/WinformsSingleWindowProvider.cs b/MatterControl.Winforms/WinformsSingleWindowProvider.cs index 4d64481a6..7830e3467 100644 --- a/MatterControl.Winforms/WinformsSingleWindowProvider.cs +++ b/MatterControl.Winforms/WinformsSingleWindowProvider.cs @@ -46,8 +46,9 @@ namespace MatterHackers.MatterControl platformWindow = openGLPlatformWindow; } - systemWindow.PlatformWindow = openGLPlatformWindow; base.ShowSystemWindow(systemWindow); + + systemWindow.PlatformWindow = openGLPlatformWindow; } } } \ No newline at end of file diff --git a/MatterControlLib/CustomWidgets/SingleWindowProvider.cs b/MatterControlLib/CustomWidgets/SingleWindowProvider.cs index 6aa895c78..6cb3f2e2f 100644 --- a/MatterControlLib/CustomWidgets/SingleWindowProvider.cs +++ b/MatterControlLib/CustomWidgets/SingleWindowProvider.cs @@ -56,6 +56,11 @@ namespace MatterHackers.Agg.UI } else { + if (systemWindow.PlatformWindow != null) + { + return; + } + var overlayWindow = new SystemWindow(_openWindows.FirstOrDefault().Width, _openWindows.FirstOrDefault().Height) { PlatformWindow = platformWindow