From 9f75292a602ba22b1a3a46f8a161020d2f847565 Mon Sep 17 00:00:00 2001 From: Sean Harmer Date: Tue, 12 Nov 2013 13:43:37 +0000 Subject: Remove side effects of QGLXContext::queryDummyContext() Task-number: QTBUG-34782 Change-Id: I411c89238b3002a118b1750af0157ccff5c78712 Reviewed-by: Gunnar Sletta --- src/plugins/platforms/xcb/qglxintegration.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 4ac4cf21ab..d05de63c8f 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -431,6 +431,11 @@ void QGLXContext::queryDummyContext() if (skip) return; + QOpenGLContext *oldContext = QOpenGLContext::currentContext(); + QSurface *oldSurface = 0; + if (oldContext) + oldSurface = oldContext->surface(); + QOffscreenSurface surface; surface.create(); QOpenGLContext context; @@ -446,6 +451,9 @@ void QGLXContext::queryDummyContext() break; } } + + if (oldContext && oldSurface) + oldContext->makeCurrent(oldSurface); } bool QGLXContext::supportsThreading() -- cgit v1.2.3