From cfd4b4924f39f96eea55a8398362a1d637776ae5 Mon Sep 17 00:00:00 2001 From: Patrick Dawson Date: Wed, 17 Jan 2024 18:31:15 +0100 Subject: [PATCH] Improve show/hide --- addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs b/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs index 0405520..3152c60 100644 --- a/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs +++ b/addons/imgui-godot/ImGuiGodot/ImGuiLayer.cs @@ -129,12 +129,6 @@ private void OnChangeVisibility() if (Visible) { ProcessMode = ProcessModeEnum.Always; - // TODO: fix position with multiple monitors - //foreach (Node child in GetChildren()) - //{ - // if (child is Window w) - // w.Show(); - //} } else { @@ -142,14 +136,16 @@ private void OnChangeVisibility() Internal.State.Instance.Renderer.OnHide(); _subViewportSize = Vector2I.Zero; RenderingServer.CanvasItemClear(_ci); - //foreach (Node child in GetChildren()) - //{ - // if (child is Window w) - // w.Hide(); - //} + CallDeferred(MethodName.FinishHide); } } + private static void FinishHide() + { + ImGui.NewFrame(); + ImGuiGD.Render(); + } + public override void _Process(double delta) { var winSize = _window.Size;