summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_x11.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgl_x11.cpp')
-rw-r--r--src/opengl/qgl_x11.cpp13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index cb1da18..da7972d 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -791,22 +791,15 @@ void QGLContext::makeCurrent()
if (!ok)
qWarning("QGLContext::makeCurrent(): Failed.");
- if (ok) {
- if (!qgl_context_storage.hasLocalData() && QThread::currentThread())
- qgl_context_storage.setLocalData(new QGLThreadContext);
- if (qgl_context_storage.hasLocalData())
- qgl_context_storage.localData()->context = this;
- currentCtx = this;
- }
+ if (ok)
+ QGLContextPrivate::setCurrentContext(this);
}
void QGLContext::doneCurrent()
{
Q_D(QGLContext);
glXMakeCurrent(qt_x11Info(d->paintDevice)->display(), 0, 0);
- if (qgl_context_storage.hasLocalData())
- qgl_context_storage.localData()->context = 0;
- currentCtx = 0;
+ QGLContextPrivate::setCurrentContext(0);
}