summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qglxintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/xcb/qglxintegration.cpp')
-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()