aboutsummaryrefslogtreecommitdiffstats
path: root/unix/x0vncserver/XPixelBuffer.cxx
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2008-06-02 11:56:57 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2008-06-02 11:56:57 +0000
commit429ea9689b1793cee77ea3e9fa23ed6a53d8c7e6 (patch)
treeb7d2f04f2bf5197361a4c6f2b16ece795b700753 /unix/x0vncserver/XPixelBuffer.cxx
parent2c019834000c25f005a1a042c5c544d0190269c2 (diff)
downloadtigervnc-429ea9689b1793cee77ea3e9fa23ed6a53d8c7e6.tar.gz
tigervnc-429ea9689b1793cee77ea3e9fa23ed6a53d8c7e6.zip
Grabbing the screen moved from PollingManager to XPixelBuffer.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2568 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/x0vncserver/XPixelBuffer.cxx')
-rw-r--r--unix/x0vncserver/XPixelBuffer.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/unix/x0vncserver/XPixelBuffer.cxx b/unix/x0vncserver/XPixelBuffer.cxx
index 78ac5588..2692c18a 100644
--- a/unix/x0vncserver/XPixelBuffer.cxx
+++ b/unix/x0vncserver/XPixelBuffer.cxx
@@ -20,6 +20,8 @@
// XPixelBuffer.cxx
//
+#include <vector>
+#include <rfb/Region.h>
#include <X11/Xlib.h>
#include <x0vncserver/XPixelBuffer.h>
@@ -36,6 +38,8 @@ XPixelBuffer::XPixelBuffer(Display *dpy, Image* image,
m_offsetTop(offsetTop),
m_stride(image->xim->bytes_per_line * 8 / image->xim->bits_per_pixel)
{
+ // Get initial screen image.
+ m_image->get(DefaultRootWindow(m_dpy), m_offsetLeft, m_offsetTop);
}
XPixelBuffer::~XPixelBuffer()
@@ -45,6 +49,11 @@ XPixelBuffer::~XPixelBuffer()
void
XPixelBuffer::grabRegion(const rfb::Region& region)
{
- // m_image->get(DefaultRootWindow(m_dpy), m_offsetLeft, m_offsetTop);
+ std::vector<Rect> rects;
+ std::vector<Rect>::const_iterator i;
+ region.get_rects(&rects);
+ for (i = rects.begin(); i != rects.end(); i++) {
+ grabRect(*i);
+ }
}