Take group hint into account when sorting threads.

This commit is contained in:
Bartosz Taudul 2024-08-03 20:11:55 +02:00
parent dbf6274bff
commit 1390c8c9e3
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -608,7 +608,10 @@ void View::DrawOptions()
ImGui::SameLine();
if( ImGui::SmallButton( "Sort" ) )
{
std::sort( m_threadOrder.begin(), m_threadOrder.end(), [this] ( const auto& lhs, const auto& rhs ) { return strcmp( m_worker.GetThreadName( lhs->id ), m_worker.GetThreadName( rhs->id ) ) < 0; } );
std::sort( m_threadOrder.begin(), m_threadOrder.end(), [this] ( const auto& lhs, const auto& rhs ) {
if( lhs->groupHint != rhs->groupHint ) return lhs->groupHint < rhs->groupHint;
return strcmp( m_worker.GetThreadName( lhs->id ), m_worker.GetThreadName( rhs->id ) ) < 0;
} );
}
const auto wposx = ImGui::GetCursorScreenPos().x;