From 85af1527e43e37dc7bec50759254d2af96c2fd7a Mon Sep 17 00:00:00 2001 From: Marcos Mello Date: Sat, 18 Nov 2023 19:52:53 -0300 Subject: [PATCH] Do not query idle state unnecessarily From https://github.com/CauldronDevelopmentLLC/cbang/pull/129#issuecomment-1793288850 --- src/fah/client/OS.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fah/client/OS.cpp b/src/fah/client/OS.cpp index 941d45a..1fadd8f 100644 --- a/src/fah/client/OS.cpp +++ b/src/fah/client/OS.cpp @@ -29,6 +29,7 @@ #include "OS.h" #include +#include #if defined(_WIN32) #include "win/WinOSImpl.h" @@ -90,7 +91,7 @@ void OS::togglePause() const { void OS::update() { - if (isSystemIdle() != idle) { + if (app.getConfig().getOnIdle() && isSystemIdle() != idle) { idle = !idle; app.triggerUpdate(); }