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.
This commit is contained in:
Vlad Zahorodnii 2021-07-03 14:05:04 +03:00
parent 12b14779ba
commit 9f6b5ea44f

View file

@ -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);
}