From 547325f2708338ad4888768d5311b3b1d6cf5c16 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 29 Mar 2024 21:46:24 +0100 Subject: [PATCH] Reduce framerate on Wayland when profiler window has no focus. --- profiler/src/BackendWayland.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/profiler/src/BackendWayland.cpp b/profiler/src/BackendWayland.cpp index 65e91729..4891c541 100644 --- a/profiler/src/BackendWayland.cpp +++ b/profiler/src/BackendWayland.cpp @@ -876,6 +876,7 @@ void Backend::Run() { while( s_running && wl_display_dispatch( s_dpy ) != -1 ) { + if( !s_hasFocus ) std::this_thread::sleep_for( std::chrono::milliseconds( 50 ) ); s_redraw(); s_mainThreadTasks->Run(); }