diff options
author | Pierre Ossman <ossman@cendio.se> | 2011-11-08 12:44:10 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2011-11-08 12:44:10 +0000 |
commit | bbf955ebd77320fb7f95efc3ac140feced109ed8 (patch) | |
tree | 6fe96cab7fa2e0d52689db4c58ce386c0f4183dc /common/rfb/VNCServerST.h | |
parent | 5bc20a699359dfba501880bc776f8fd3c8e5b889 (diff) | |
download | tigervnc-bbf955ebd77320fb7f95efc3ac140feced109ed8.tar.gz tigervnc-bbf955ebd77320fb7f95efc3ac140feced109ed8.zip |
Reimplement the deferred update handling, this time in a more robust and
well-behaved manner.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4784 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common/rfb/VNCServerST.h')
-rw-r--r-- | common/rfb/VNCServerST.h | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/common/rfb/VNCServerST.h b/common/rfb/VNCServerST.h index c74be903..47a48019 100644 --- a/common/rfb/VNCServerST.h +++ b/common/rfb/VNCServerST.h @@ -23,6 +23,8 @@ #ifndef __RFB_VNCSERVERST_H__ #define __RFB_VNCSERVERST_H__ +#include <sys/time.h> + #include <list> #include <rfb/SDesktop.h> @@ -31,6 +33,7 @@ #include <rfb/LogWriter.h> #include <rfb/Blacklist.h> #include <rfb/Cursor.h> +#include <rfb/Timer.h> #include <network/Socket.h> #include <rfb/ListConnInfo.h> #include <rfb/ScreenSet.h> @@ -42,7 +45,9 @@ namespace rfb { class PixelBuffer; class KeyRemapper; - class VNCServerST : public VNCServer, public network::SocketServer { + class VNCServerST : public VNCServer, + public Timer::Callback, + public network::SocketServer { public: // -=- Constructors @@ -85,7 +90,6 @@ namespace rfb { virtual void serverCutText(const char* str, int len); virtual void add_changed(const Region ®ion); virtual void add_copied(const Region &dest, const Point &delta); - virtual void tryUpdate(); virtual void setCursor(int width, int height, const Point& hotspot, void* cursorData, void* mask); virtual void setCursorPos(const Point& p); @@ -192,6 +196,11 @@ namespace rfb { friend class VNCSConnectionST; + // Timer callbacks + virtual bool handleTimeout(Timer* t); + + // - Internal methods + void startDesktop(); static LogWriter connectionsLog; @@ -222,7 +231,10 @@ namespace rfb { int authClientCount(); bool needRenderedCursor(); - void checkUpdate(); + void startDefer(); + bool checkDefer(); + void tryUpdate(); + bool checkUpdate(); void notifyScreenLayoutChange(VNCSConnectionST *requester); @@ -235,6 +247,10 @@ namespace rfb { time_t lastConnectionTime; bool disableclients; + + Timer deferTimer; + bool deferPending; + struct timeval deferStart; }; }; |