From 5c1aec723dc0388e578e14de0059719f491313c8 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 4 Mar 2018 18:52:32 +0100 Subject: [PATCH] Fix thread name clashes in ImGui. --- server/TracyView.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 5bd997fa..4de9fcf4 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -2625,9 +2625,12 @@ void View::DrawOptions() ImGui::Separator(); ImGui::Text( "Visible threads:" ); ImGui::Indent( tw ); + int idx = 0; for( const auto& t : m_worker.GetThreadData() ) { + ImGui::PushID( idx++ ); ImGui::Checkbox( m_worker.GetThreadString( t->id ), &Visible( t ) ); + ImGui::PopID(); } ImGui::Unindent( tw ); ImGui::End(); @@ -2939,9 +2942,12 @@ void View::DrawFindZone() ImGui::Separator(); ImGui::Text( "Found zones:" ); + int idx = 0; for( auto& v : m_findZone.result ) { + ImGui::PushID( idx++ ); const bool expand = ImGui::TreeNode( m_worker.GetThreadString( v->id ) ); + ImGui::PopID(); ImGui::SameLine(); ImGui::TextColored( ImVec4( 0.5f, 0.5f, 0.5f, 1.0f ), "(%s)", RealToString( v->timeline.size(), true ) );