summaryrefslogtreecommitdiffstats
path: root/src/opengl/qglpixelbuffer_x11.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-02-10 13:37:58 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-02-10 13:37:58 (GMT)
commit358bbd707bb5e0ce255559e45f8dedb9e9243a9d (patch)
treebae918b7c608edef529a1d77feb48925bb8b1c06 /src/opengl/qglpixelbuffer_x11.cpp
parent0d27306664188a61571d31a38fec1d9040aae5f6 (diff)
downloadQt-358bbd707bb5e0ce255559e45f8dedb9e9243a9d.zip
Qt-358bbd707bb5e0ce255559e45f8dedb9e9243a9d.tar.gz
Qt-358bbd707bb5e0ce255559e45f8dedb9e9243a9d.tar.bz2
Fixed usage of QGLPixelBuffer with share widgets on other X11 screens.
When trying to share the internal pbo context with a widget context, the pbo context needs to be created on the same X11 screen as the widget context. Task-number: QTBUG-8047 Reviewed-by: Kim
Diffstat (limited to 'src/opengl/qglpixelbuffer_x11.cpp')
-rw-r--r--src/opengl/qglpixelbuffer_x11.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/opengl/qglpixelbuffer_x11.cpp b/src/opengl/qglpixelbuffer_x11.cpp
index 5b34cbb..32a42a2 100644
--- a/src/opengl/qglpixelbuffer_x11.cpp
+++ b/src/opengl/qglpixelbuffer_x11.cpp
@@ -181,7 +181,11 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge
qt_format_to_attrib_list(f, attribs);
- GLXFBConfig *configs = glXChooseFBConfig(X11->display, X11->defaultScreen, attribs, &num_configs);
+ int screen = X11->defaultScreen;
+ if (shareWidget)
+ screen = shareWidget->x11Info().screen();
+
+ GLXFBConfig *configs = glXChooseFBConfig(X11->display, screen, attribs, &num_configs);
if (configs && num_configs) {
int res;
glXGetFBConfigAttrib(X11->display, configs[0], GLX_LEVEL, &res);