From cd89668d0c4fabeafe5b65223e58d652b6542519 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 27 Oct 2024 15:07:24 +0100 Subject: Reduce cpu usage when ui is not visible --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3d367fa..0cc8076 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include @@ -160,7 +161,8 @@ int main(int argc, char **argv) { global_hotkeys.poll_events(); overlay->handle_events(); - overlay->draw(); + if(!overlay->draw()) + std::this_thread::sleep_for(std::chrono::milliseconds(50)); } fprintf(stderr, "info: shutting down!\n"); -- cgit v1.2.3