Browse Source

Metrics: Fix not being able to expand "ParentWindow" when parent window is same as root window.

omar 5 years ago
parent
commit
f9630e60c5
1 changed files with 5 additions and 1 deletions
  1. 5 1
      imgui.cpp

+ 5 - 1
imgui.cpp

@@ -9992,7 +9992,11 @@ void ImGui::ShowMetricsWindow(bool* p_open)
             if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size))
             if (!ImGui::TreeNode(label, "%s (%d)", label, windows.Size))
                 return;
                 return;
             for (int i = 0; i < windows.Size; i++)
             for (int i = 0; i < windows.Size; i++)
+            {
+                ImGui::PushID(windows[i]);
                 Funcs::NodeWindow(windows[i], "Window");
                 Funcs::NodeWindow(windows[i], "Window");
+                ImGui::PopID();
+            }
             ImGui::TreePop();
             ImGui::TreePop();
         }
         }
 
 
@@ -10003,7 +10007,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
                 ImGui::BulletText("%s: NULL", label);
                 ImGui::BulletText("%s: NULL", label);
                 return;
                 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)
             if (ImGui::IsItemHovered() && window->WasActive)
                 ImGui::GetForegroundDrawList()->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
                 ImGui::GetForegroundDrawList()->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
             if (!open)
             if (!open)