diff --git a/profiler/src/BackendGlfw.cpp b/profiler/src/BackendGlfw.cpp index be05d844..f479bd61 100644 --- a/profiler/src/BackendGlfw.cpp +++ b/profiler/src/BackendGlfw.cpp @@ -13,6 +13,7 @@ #include #include +#include "profiler/TracyConfig.hpp" #include "profiler/TracyImGui.hpp" #include "Backend.hpp" @@ -25,6 +26,9 @@ static RunQueue* s_mainThreadTasks; static WindowPosition* s_winPos; static bool s_iconified; +extern tracy::Config s_config; + + static void glfw_error_callback( int error, const char* description ) { fprintf(stderr, "Error %d: %s\n", error, description); @@ -146,10 +150,7 @@ void Backend::Run() { glfwPollEvents(); s_redraw(); - if( !glfwGetWindowAttrib( s_window, GLFW_FOCUSED ) ) - { - std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) ); - } + if( s_config.focusLostLimit && !glfwGetWindowAttrib( s_window, GLFW_FOCUSED ) ) std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) ); s_mainThreadTasks->Run(); } }