Compare commits

...

2 Commits

Author SHA1 Message Date
Sylvain Becker
ae7239979e
Merge 91637f4578 into 228e58262e 2024-03-31 21:51:58 +08:00
Sylvain
91637f4578
Fix X11 + EGL + GLFW_TRANSPARENT_FRAMEBUFFER by ignoring visual id
(tested with example/gears.c)
2023-02-14 23:46:51 +01:00

View File

@ -868,7 +868,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;
@ -887,6 +893,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;