Make readback-glx working again in wayland.
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>
Tue, 21 Jun 2011 08:21:46 +0000 (10:21 +0200)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>
Tue, 21 Jun 2011 08:23:28 +0000 (10:23 +0200)
src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp
src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h

index df55caa..c7f0028 100644 (file)
@@ -49,8 +49,9 @@ QWaylandReadbackGlxWindow::QWaylandReadbackGlxWindow(QWindow *window, QWaylandRe
     , m_glxIntegration(glxIntegration)
     , m_buffer(0)
     , m_pixmap(0)
-    , m_config(qglx_findConfig(glxIntegration->xDisplay(), glxIntegration->screen(), window->glFormat()))
+    , m_config(0)
     , m_glxPixmap(0)
+    , m_window(window)
 {
 }
 
@@ -107,6 +108,9 @@ void QWaylandReadbackGlxWindow::createSurface()
     m_pixmap = XCreatePixmap(m_glxIntegration->xDisplay(), m_glxIntegration->rootWindow(), size.width(), size.height(), depth);
     XSync(m_glxIntegration->xDisplay(), False);
 
+    if (!m_config)
+        m_config = qglx_findConfig(m_glxIntegration->xDisplay(), m_glxIntegration->screen(), m_window->glFormat());
+
     m_glxPixmap = glXCreatePixmap(m_glxIntegration->xDisplay(), m_config, m_pixmap,0);
 
     if (!m_glxPixmap)