mirror of
https://repo.dec05eba.com/gpu-screen-recorder-ui
synced 2026-04-14 22:42:28 +09:00
Reduce cpu usage when ui is not visible
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <thread>
|
||||
|
||||
#include <X11/keysym.h>
|
||||
#include <mglpp/mglpp.hpp>
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user