This commit is contained in:
Sylvain Becker 2025-12-01 14:23:56 +08:00 committed by GitHub
commit fdca273dfa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -869,7 +869,13 @@ GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
XVisualInfo desired;
EGLConfig native;
EGLint visualID = 0, count = 0;
const long vimask = VisualScreenMask | VisualIDMask;
long vimask;
if (fbconfig->transparent) {
vimask = VisualScreenMask;
} else {
vimask = VisualScreenMask | VisualIDMask;
}
if (!chooseEGLConfig(ctxconfig, fbconfig, &native))
return GLFW_FALSE;
@ -888,6 +894,21 @@ GLFWbool _glfwChooseVisualEGL(const _GLFWwndconfig* wndconfig,
return GLFW_FALSE;
}
if (fbconfig->transparent) {
int i;
for (i = 0; i < count; i++) {
XVisualInfo *vinfo = &result[i];
if (vinfo->class == DirectColor || vinfo->class == TrueColor) {
if (vinfo->depth == 32) {
*visual = vinfo->visual;
*depth = vinfo->depth;
XFree(result);
return GLFW_TRUE;
}
}
}
}
*visual = result->visual;
*depth = result->depth;