From befc58771c0c2b95df6b84b667b2ccd7fc11b768 Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 8 Dec 2017 14:48:25 +0100 Subject: [PATCH] Combo: Recycling windows by using a stack number instead of a unique id, wasitng less windows. --- imgui.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 793d3738..bf4abb01 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -9135,8 +9135,8 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF SetNextWindowSizeConstraints(ImVec2(w, 0.0f), ImVec2(FLT_MAX, CalcMaxPopupHeightFromItemCount(popup_max_height_in_items))); } - char name[20]; - ImFormatString(name, IM_ARRAYSIZE(name), "##combo_%08X", id); + char name[16]; + ImFormatString(name, IM_ARRAYSIZE(name), "##combo_%d", g.CurrentPopupStack.Size); // Recycle windows based on depth // Peak into expected window size so we can position it if (ImGuiWindow* popup_window = FindWindowByName(name))