From ca125bd44c9f85580aee3d61d02b39904f37bb25 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 3 Sep 2022 23:35:35 +0200 Subject: [PATCH] Collapse Tracy threads by default. Note that this will likely work only when loading existing traces. In live captures the thread name may not have yet been retrieved at the point when timeline item insertion occurs, which will prevent the check from succeeding. --- server/TracyTimelineItem.hpp | 5 +++-- server/TracyTimelineItemThread.cpp | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/TracyTimelineItem.hpp b/server/TracyTimelineItem.hpp index 655bea06..48ad6c57 100644 --- a/server/TracyTimelineItem.hpp +++ b/server/TracyTimelineItem.hpp @@ -39,12 +39,13 @@ protected: virtual bool IsEmpty() const { return false; } + bool m_visible; + bool m_showFull; + private: void AdjustThreadHeight( bool firstFrame, int oldOffset, int& offset ); float AdjustThreadPosition( float wy, int& offset ); - bool m_visible; - bool m_showFull; int m_height; int m_offset; diff --git a/server/TracyTimelineItemThread.cpp b/server/TracyTimelineItemThread.cpp index 7b515107..c100bd5c 100644 --- a/server/TracyTimelineItemThread.cpp +++ b/server/TracyTimelineItemThread.cpp @@ -16,6 +16,11 @@ TimelineItemThread::TimelineItemThread( View& view, Worker& worker, const Thread , m_thread( thread ) , m_ghost( false ) { + auto name = worker.GetThreadName( thread->id ); + if( strncmp( name, "Tracy ", 6 ) == 0 ) + { + m_showFull = false; + } } bool TimelineItemThread::IsEmpty() const