diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index a7229113..7a9dc4d1 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -267,57 +267,8 @@ static void DrawContents() static uint16_t reconnectPort; static bool showFilter = false; - int display_w, display_h; - bptr->NewFrame( display_w, display_h ); - - static int activeFrames = 3; - if( tracy::WasActive() || ( view && view->WasActive() ) ) - { - activeFrames = 3; - } - else - { - auto ctx = ImGui::GetCurrentContext(); - if( ctx->DimBgRatio != 0 && ctx->DimBgRatio != 1 ) - { - activeFrames = 3; - } - else - { - auto& inputQueue = ctx->InputEventsQueue; - if( !inputQueue.empty() ) - { - for( auto& v : inputQueue ) - { - if( v.Type != ImGuiInputEventType_MouseViewport ) - { - activeFrames = 3; - break; - } - } - } - } - } - if( activeFrames == 0 ) - { - std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) ); - return; - } - activeFrames--; - - ImGui::NewFrame(); - tracy::MouseFrame(); - - setlocale( LC_NUMERIC, "C" ); - if( !view ) { - if( s_customTitle ) - { - s_customTitle = false; - bptr->SetTitle( title ); - } - const auto time = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch() ).count(); if( !broadcastListen ) { @@ -398,6 +349,58 @@ static void DrawContents() } } } + } + + int display_w, display_h; + bptr->NewFrame( display_w, display_h ); + + static int activeFrames = 3; + if( tracy::WasActive() || ( view && view->WasActive() ) ) + { + activeFrames = 3; + } + else + { + auto ctx = ImGui::GetCurrentContext(); + if( ctx->DimBgRatio != 0 && ctx->DimBgRatio != 1 ) + { + activeFrames = 3; + } + else + { + auto& inputQueue = ctx->InputEventsQueue; + if( !inputQueue.empty() ) + { + for( auto& v : inputQueue ) + { + if( v.Type != ImGuiInputEventType_MouseViewport ) + { + activeFrames = 3; + break; + } + } + } + } + } + if( activeFrames == 0 ) + { + std::this_thread::sleep_for( std::chrono::milliseconds( 16 ) ); + return; + } + activeFrames--; + + ImGui::NewFrame(); + tracy::MouseFrame(); + + setlocale( LC_NUMERIC, "C" ); + + if( !view ) + { + if( s_customTitle ) + { + s_customTitle = false; + bptr->SetTitle( title ); + } auto& style = ImGui::GetStyle(); style.Colors[ImGuiCol_WindowBg] = ImVec4( 0.129f, 0.137f, 0.11f, 1.f ); @@ -656,9 +659,10 @@ static void DrawContents() ImGui::SetColumnWidth( 1, w * 0.175f ); ImGui::SetColumnWidth( 2, w * 0.425f ); } - std::lock_guard lock( resolvLock ); + const auto time = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch() ).count(); int idx = 0; int passed = 0; + std::lock_guard lock( resolvLock ); for( auto& v : clients ) { const bool badProto = v.second.protocolVersion != tracy::ProtocolVersion;