From 2a08687afe3b4eebf4f1eb34c50a5c4686ee0c0a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 5 Aug 2018 16:57:21 +0200 Subject: [PATCH] Left click on message marker displays it on the msg list. --- server/TracyView.cpp | 12 ++++++++++++ server/TracyView.hpp | 1 + 2 files changed, 13 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 40479ad6..17a4d85b 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -228,6 +228,7 @@ View::View( const char* addr ) , m_zoneSrcLocHighlight( 0 ) , m_lockHighlight { -1 } , m_msgHighlight( nullptr ) + , m_msgToFocus( nullptr ) , m_gpuInfoWindow( nullptr ) , m_callstackInfoWindow( 0 ) , m_memoryAllocInfoWindow( -1 ) @@ -269,6 +270,7 @@ View::View( FileRead& f ) , m_zoneInfoWindow( nullptr ) , m_zoneSrcLocHighlight( 0 ) , m_msgHighlight( nullptr ) + , m_msgToFocus( nullptr ) , m_gpuInfoWindow( nullptr ) , m_callstackInfoWindow( 0 ) , m_memoryAllocInfoWindow( -1 ) @@ -1378,6 +1380,11 @@ void View::DrawZones() ImGui::EndTooltip(); m_msgHighlight = *it; + if( ImGui::IsMouseClicked( 0 ) ) + { + m_showMessages = true; + m_msgToFocus = *it; + } if( ImGui::IsMouseClicked( 2 ) ) { CenterAtTime( (*it)->time ); @@ -3936,6 +3943,11 @@ void View::DrawMessages() { m_msgHighlight = v; } + if( m_msgToFocus == v ) + { + ImGui::SetScrollHere(); + m_msgToFocus = nullptr; + } ImGui::PopID(); ImGui::NextColumn(); ImGui::Text( "%s", m_worker.GetThreadString( v->thread ) ); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 951bbebc..24ad3b7e 100644 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -189,6 +189,7 @@ private: DecayValue m_zoneSrcLocHighlight; LockHighlight m_lockHighlight; DecayValue m_msgHighlight; + const MessageData* m_msgToFocus; const GpuEvent* m_gpuInfoWindow; const GpuEvent* m_gpuHighlight; uint64_t m_gpuInfoWindowThread;