From 14a1d6d3c799baf934912a0d9003a2358820cd86 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 21 Jun 2011 10:21:46 +0200 Subject: [PATCH] Make readback-glx working again in wayland. --- .../gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp | 6 +++++- .../wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp index df55caa..c7f0028 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp +++ b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp @@ -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) diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h index 60b22a4..4f753c6 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h +++ b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.h @@ -69,6 +69,7 @@ private: Pixmap m_pixmap; GLXFBConfig m_config; GLXPixmap m_glxPixmap; + QWindow *m_window; }; #endif // QWAYLANDREADBACKGLXWINDOW_H -- 2.7.4