Throttle overlapping screen updates

We need to make sure the display server has finished reading our
previous update before we overwrite the buffer with the next update.
diff --git a/vncviewer/X11PixelBuffer.h b/vncviewer/X11PixelBuffer.h
index c2ffdc2..115984d 100644
--- a/vncviewer/X11PixelBuffer.h
+++ b/vncviewer/X11PixelBuffer.h
@@ -24,6 +24,8 @@
 #include <sys/shm.h>
 #include <X11/extensions/XShm.h>
 
+#include <list>
+
 #include "PlatformPixelBuffer.h"
 
 class X11PixelBuffer: public PlatformPixelBuffer {
@@ -33,12 +35,19 @@
 
   virtual void draw(int src_x, int src_y, int x, int y, int w, int h);
 
+  virtual bool isRendering(void);
+
 protected:
   int setupShm();
 
+  static int handleSystemEvent(void* event, void* data);
+
 protected:
   XShmSegmentInfo *shminfo;
   XImage *xim;
+  int pendingPutImage;
+
+  static std::list<X11PixelBuffer*> shmList;
 };