From 9f6b5ea44f31884158fa6f235610841e84ac9e71 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Sat, 3 Jul 2021 14:05:04 +0300 Subject: [PATCH] x11: Call eglGetPlatformDisplayEXT() without attrs There are EGL implementations that will refuse to create a context if the share context belongs to other EGLDisplay. Currently, that's the case on some platforms. If eglGetPlatformDisplayEXT() is called with the same parameters, it'll return the same EGLDisplay. The main motivation behind this change is to ensure that both kwin and Qt share the same EGLDisplay, QtXCB calls eglGetPlatformDisplayEXT() without any additional args. If EGL_PLATFORM_X11_SCREEN_EXT is not specified via attrs, the EGL implementation will use the default screen, which is the same as m_x11ScreenNumber. --- src/plugins/platforms/x11/common/eglonxbackend.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/plugins/platforms/x11/common/eglonxbackend.cpp b/src/plugins/platforms/x11/common/eglonxbackend.cpp index 90fc7e432e..c62ec170d3 100644 --- a/src/plugins/platforms/x11/common/eglonxbackend.cpp +++ b/src/plugins/platforms/x11/common/eglonxbackend.cpp @@ -142,12 +142,7 @@ bool EglOnXBackend::initRenderingContext() return false; } - const int attribs[] = { - EGL_PLATFORM_X11_SCREEN_EXT, m_x11ScreenNumber, - EGL_NONE - }; - - dpy = eglGetPlatformDisplayEXT(EGL_PLATFORM_X11_EXT, m_x11Display, attribs); + dpy = eglGetPlatformDisplayEXT(EGL_PLATFORM_X11_EXT, m_x11Display, nullptr); } else { dpy = eglGetDisplay(m_x11Display); }