From f9630e60c599f3b97ac31f96d6c13e4d30a502d7 Mon Sep 17 00:00:00 2001 From: omar Date: Tue, 7 Jan 2020 21:32:00 +0100 Subject: [PATCH] Metrics: Fix not being able to expand "ParentWindow" when parent window is same as root window. --- imgui.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/imgui.cpp b/imgui.cpp index b8163e62..549ee75e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9992,7 +9992,11 @@ void ImGui::ShowMetricsWindow(bool* p_open) if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size)) return; for (int i = 0; i < windows.Size; i++) + { + ImGui::PushID(windows[i]); Funcs::NodeWindow(windows[i], "Window"); + ImGui::PopID(); + } ImGui::TreePop(); } @@ -10003,7 +10007,7 @@ void ImGui::ShowMetricsWindow(bool* p_open) ImGui::BulletText("%s: NULL", label); return; } - bool open = ImGui::TreeNode(window, "%s '%s', %d @ 0x%p", label, window->Name, (window->Active || window->WasActive), window); + bool open = ImGui::TreeNode(label, "%s '%s', %d @ 0x%p", label, window->Name, (window->Active || window->WasActive), window); if (ImGui::IsItemHovered() && window->WasActive) ImGui::GetForegroundDrawList()->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255)); if (!open)