VNC-151 Adjust screenshot timer initialization and interval handling

This commit is contained in:
El 2026-05-07 12:04:37 +00:00
parent 39d5b1b7ba
commit 11214a870a
No known key found for this signature in database
GPG key ID: EB3F4C9EA29CDE59
2 changed files with 5 additions and 1 deletions

View file

@ -264,7 +264,7 @@ VNCServerST::VNCServerST(const char* name_, SDesktop* desktop_, const video_enco
benchmark(file_name, Server::benchmarkResults.getValueStr());
}
screenshotTimer.start(SCREENSHOT_INTERVAL_MS);
screenshotTimer.start(FIRST_SCREENSHOT_INTERVAL_MS);
}
VNCServerST::~VNCServerST()
@ -773,6 +773,9 @@ bool VNCServerST::handleTimeout(Timer* t)
apimessager->mainUpdateScreen(getPixelBuffer());
}
if (screenshotTimer.getTimeoutMs() < SCREENSHOT_INTERVAL_MS)
screenshotTimer.start(SCREENSHOT_INTERVAL_MS);
return true;
}

View file

@ -51,6 +51,7 @@ namespace rfb {
public Timer::Callback,
public network::SocketServer {
public:
constexpr static int FIRST_SCREENSHOT_INTERVAL_MS = 5000;
constexpr static int SCREENSHOT_INTERVAL_MS = 60000;
// -=- Constructors