]> source.dussan.org Git - tigervnc.git/commitdiff
Minor code refactoring: loading initial screen data moved from XDesktop to PollingMan...
authorConstantin Kaplinsky <const@tightvnc.com>
Mon, 22 May 2006 05:45:20 +0000 (05:45 +0000)
committerConstantin Kaplinsky <const@tightvnc.com>
Mon, 22 May 2006 05:45:20 +0000 (05:45 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@572 3789f03b-4d11-0410-bbf8-ca57d06f2519

x0vncserver/PollingManager.cxx
x0vncserver/x0vncserver.cxx

index 3c6be4f8ac765e50a7d9268ce1dcf621e35e287f..8328101ae1e805e0dda36885c4bbb762c2bfc516 100644 (file)
@@ -72,6 +72,9 @@ PollingManager::PollingManager(Display *dpy, Image *image,
   m_widthTiles = (m_width + 31) / 32;
   m_heightTiles = (m_height + 31) / 32;
 
+  // Get initial screen image.
+  m_image->get(DefaultRootWindow(m_dpy), m_offsetLeft, m_offsetTop);
+
   // Create additional images used in the polling algorithm.
   // FIXME: verify that these images use the same pixel format as in m_image.
   m_rowImage = factory->newImage(m_dpy, m_width, 1);
index 70a5361b7cc5f43d827bd441fee0acc61e25af1a..530f60e88f5fe4d8d00b7fd4aabe6687e67ca2e9 100644 (file)
@@ -169,12 +169,12 @@ public:
     vlog.info("Enabling %d button%s of X pointer device",
               maxButtons, (maxButtons != 1) ? "s" : "");
 
+    // Create an image for maintaining framebuffer data.
     ImageFactory factory((bool)useShm, (bool)useOverlay);
     image = factory.newImage(dpy, geometry->width(), geometry->height());
-    image->get(DefaultRootWindow(dpy),
-               geometry->offsetLeft(), geometry->offsetTop());
 
-    // FIXME: Duplication in using offsets above and here:
+    // Create polling manager object. It will track screen changes and
+    // keep pixels of the `image' object up to date.
     pollmgr = new PollingManager(dpy, image, &factory,
                                  geometry->offsetLeft(),
                                  geometry->offsetTop());