From 74057543aadc6195af9c860d240f9f790b7ce50b Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Mon, 18 Mar 2024 14:28:00 -0700 Subject: [PATCH] [glass] Don't limit window name+label to 128 chars (#6447) --- glass/src/lib/native/cpp/Window.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/glass/src/lib/native/cpp/Window.cpp b/glass/src/lib/native/cpp/Window.cpp index 32c7a2104d..64b043ffb1 100644 --- a/glass/src/lib/native/cpp/Window.cpp +++ b/glass/src/lib/native/cpp/Window.cpp @@ -4,9 +4,11 @@ #include "glass/Window.h" +#include + +#include #include #include -#include #include "glass/Context.h" #include "glass/Storage.h" @@ -55,15 +57,14 @@ void Window::Display() { ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, m_padding); } - char label[128]; + std::string label; if (m_name.empty()) { - wpi::format_to_n_c_str(label, sizeof(label), "{}###{}", m_defaultName, - m_id); + label = fmt::format("{}###{}", m_defaultName, m_id); } else { - wpi::format_to_n_c_str(label, sizeof(label), "{}###{}", m_name, m_id); + label = fmt::format("{}###{}", m_name, m_id); } - if (Begin(label, &m_visible, m_flags)) { + if (Begin(label.c_str(), &m_visible, m_flags)) { if (m_renamePopupEnabled || m_view->HasSettings()) { bool isClicked = (ImGui::IsMouseReleased(ImGuiMouseButton_Right) && ImGui::IsItemHovered());