diff --git a/src/RhinoInside.Revit.External/ActivationGate.cs b/src/RhinoInside.Revit.External/ActivationGate.cs index 2f7b019aa..8335e089b 100644 --- a/src/RhinoInside.Revit.External/ActivationGate.cs +++ b/src/RhinoInside.Revit.External/ActivationGate.cs @@ -440,16 +440,19 @@ protected override int DispatchHook(int nCode, IntPtr wParam, IntPtr lParam) if (IsOpen) { var window = (WindowHandle) wParam; - if (HostMainWindow.Enabled && !IsExternalWindow(window, out var _)) + if (HostMainWindow != window) { - foreach (var gate in gates) + if (!HostMainWindow.Enabled && !IsExternalWindow(window, out var _)) { - try { gate.Value.Window.BringToFront(); } - catch { } - } + foreach (var gate in gates) + { + try { gate.Value.Window.BringToFront(); } + catch { } + } - windowToActivate = window; // Will be activated when our message loop is Idle. - return 1; // Prevents activation now. + windowToActivate = window; // Will be activated when our message loop is Idle. + return 1; // Prevents activation now. + } } } else diff --git a/src/RhinoInside.Revit.External/UI/UIHostApplicationUnconstrained.cs b/src/RhinoInside.Revit.External/UI/UIHostApplicationUnconstrained.cs index 311815682..b36cfd44c 100644 --- a/src/RhinoInside.Revit.External/UI/UIHostApplicationUnconstrained.cs +++ b/src/RhinoInside.Revit.External/UI/UIHostApplicationUnconstrained.cs @@ -77,7 +77,7 @@ private async void UpdateOpenViewsList(object sender, ViewActivatedEventArgs e) { OpenViews.Clear(); - // Calling GetOpenViews here is not safe, so we yeld until Idle to do so. + // Calling GetOpenViews here is not safe, so we yield until Idle to do so. await ActivationGate.Yield(); OpenViews = new HashSet(_app.Application.GetOpenViews(), ElementEqualityComparer.InterDocument); } diff --git a/src/RhinoInside.Revit/Rhinoceros.cs b/src/RhinoInside.Revit/Rhinoceros.cs index 40aceffba..017509b8f 100755 --- a/src/RhinoInside.Revit/Rhinoceros.cs +++ b/src/RhinoInside.Revit/Rhinoceros.cs @@ -40,10 +40,6 @@ internal static bool InitEto(Assembly assembly) if (Eto.Forms.Application.Instance is null) new Eto.Forms.Application(Eto.Platforms.Wpf).Attach(); -#if RHINO_8 - Eto.Wpf.Forms.Controls.TextBoxHandler.EnableNoGCRegionDefault = false; -#endif - return true; }