summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2013-11-12 13:43:37 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-14 21:15:35 +0100
commit9f75292a602ba22b1a3a46f8a161020d2f847565 (patch)
tree9de9df3e24a26c6ad82e7c89a8dfaf9d4e0e7e7a
parent038b0dae83c8fde5f3b20b92eb51cbc3534a037b (diff)
Remove side effects of QGLXContext::queryDummyContext()
Task-number: QTBUG-34782 Change-Id: I411c89238b3002a118b1750af0157ccff5c78712 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.cpp8
1 files changed, 8 insertions, 0 deletions
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()