diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index ce196d6..058b24e 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -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; } diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h index 3f2b5e3..64d84f0 100644 --- a/common/rfb/VNCServerST.h +++ b/common/rfb/VNCServerST.h @@ -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