summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp5
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 2086ce56e2..35b27cba0b 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -188,11 +188,8 @@ QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const
QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- // If there is a "root" window into which raster and QOpenGLWidget content is
- // composited, all other contexts must share with its context.
- QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context();
EGLDisplay dpy = context->screen() ? static_cast<QEglFSScreen *>(context->screen()->handle())->display() : display();
- QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
+ QPlatformOpenGLContext *share = context->shareHandle();
QVariant nativeHandle = context->nativeHandle();
QEglFSContext *ctx;
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index 8301be8c17..84856831c3 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -138,6 +138,14 @@ void QEglFSWindow::create()
if (!context->create())
qFatal("EGLFS: Failed to create compositing context");
compositor->setTarget(context, window());
+ // If there is a "root" window into which raster and QOpenGLWidget content is
+ // composited, all other contexts must share with its context.
+ if (!qt_gl_global_share_context()) {
+ qt_gl_set_global_share_context(context);
+ // What we set up here is in effect equivalent to the application setting
+ // AA_ShareOpenGLContexts. Set the attribute to be fully consistent.
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+ }
}
}