summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-02-10 14:37:58 +0100
committerTrond Kjernåsen <trond@trolltech.com>2010-02-10 14:37:58 +0100
commit358bbd707bb5e0ce255559e45f8dedb9e9243a9d (patch)
treebae918b7c608edef529a1d77feb48925bb8b1c06
parent0d27306664188a61571d31a38fec1d9040aae5f6 (diff)
downloadqt4-tools-358bbd707bb5e0ce255559e45f8dedb9e9243a9d.tar.gz
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
-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 5b34cbbea5..32a42a2323 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);