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);
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());