From 4c4fc7197c8151dfee3e0c28c44b80ccb1f37edd Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 27 Mar 2021 14:15:18 +0100 Subject: [PATCH] Add source preview to entry call stacks window. --- server/TracyView.cpp | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 0619cbd4..b0d13604 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -15560,7 +15560,7 @@ void View::DrawSampleParents() assert( false ); break; } - if( ImGui::IsItemClicked( 1 ) ) + if( ImGui::IsItemHovered() ) { if( m_showCallstackFrameAddress == 3 ) { @@ -15568,21 +15568,37 @@ void View::DrawSampleParents() if( sym ) { const auto symtxt = m_worker.GetString( sym->file ); - if( !ViewDispatch( symtxt, sym->line, frame.symAddr ) ) + DrawSourceTooltip( symtxt, sym->line ); + } + } + else + { + DrawSourceTooltip( txt, frame.line ); + } + if( ImGui::IsItemClicked( 1 ) ) + { + if( m_showCallstackFrameAddress == 3 ) + { + const auto sym = m_worker.GetSymbolData( frame.symAddr ); + if( sym ) + { + const auto symtxt = m_worker.GetString( sym->file ); + if( !ViewDispatch( symtxt, sym->line, frame.symAddr ) ) + { + m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); + } + } + else { m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); } } else { - m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); - } - } - else - { - if( !ViewDispatch( txt, frame.line, frame.symAddr ) ) - { - m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); + if( !ViewDispatch( txt, frame.line, frame.symAddr ) ) + { + m_sampleParentBuzzAnim.Enable( bidx, 0.5f ); + } } } }