diff options
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r-- | src/opengl/qgl.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 3e5c4fc..cfcbbf8 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -99,6 +99,10 @@ QT_BEGIN_NAMESPACE QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs; #endif +#ifdef Q_WS_X11 +extern const QX11Info *qt_x11Info(const QPaintDevice *pd); +#endif + struct QGLThreadContext { QGLContext *context; }; @@ -2448,7 +2452,10 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, #if defined(Q_WS_X11) // Try to use texture_from_pixmap - if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType) { + const QX11Info *xinfo = qt_x11Info(paintDevice); + if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType + && xinfo && xinfo->screen() == pixmap.x11Info().screen()) + { texture = bindTextureFromNativePixmap(pd, key, options); if (texture) { texture->options |= QGLContext::MemoryManagedBindOption; |