diff --git a/src/plugins/platforms/x11/standalone/eglbackend.cpp b/src/plugins/platforms/x11/standalone/eglbackend.cpp index f0855e0c9e..259e26720c 100644 --- a/src/plugins/platforms/x11/standalone/eglbackend.cpp +++ b/src/plugins/platforms/x11/standalone/eglbackend.cpp @@ -55,6 +55,7 @@ PlatformSurfaceTexture *EglBackend::createPlatformSurfaceTextureX11(SurfacePixma void EglBackend::init() { QOpenGLContext *qtShareContext = QOpenGLContext::globalShareContext(); + EGLDisplay shareDisplay = EGL_NO_DISPLAY; EGLContext shareContext = EGL_NO_CONTEXT; if (qtShareContext) { qDebug(KWIN_X11STANDALONE) << "Global share context format:" << qtShareContext->format(); @@ -65,6 +66,7 @@ void EglBackend::init() } else { QEGLNativeContext handle = qvariant_cast(nativeHandle); shareContext = handle.context(); + shareDisplay = handle.display(); } } if (shareContext == EGL_NO_CONTEXT) { @@ -72,6 +74,7 @@ void EglBackend::init() return; } + kwinApp()->platform()->setSceneEglDisplay(shareDisplay); kwinApp()->platform()->setSceneEglGlobalShareContext(shareContext); EglOnXBackend::init(); }