x11: Explicitly specify EGL platform

Mesa's eglGetDisplay() chooses the native EGL platform from
EGL_PLATFORM, limited autodetection, or the build-time default. If that
selects Wayland while SDL is using the X11 video backend, Mesa can treat
the X11 Display pointer as a wl_display and crash during
eglInitialize().

See: https://gitlab.com/qemu-project/qemu/-/work_items/3540
This commit is contained in:
Akihiko Odaki 2026-06-11 20:31:57 +09:00 committed by Frank Praznik
parent 33dd8c7fa0
commit b40b73d954
No known key found for this signature in database

View file

@ -53,7 +53,8 @@ int X11_GLES_LoadLibrary(_THIS, const char *path)
#endif
}
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, 0);
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display,
EGL_PLATFORM_X11_KHR);
}
XVisualInfo *X11_GLES_GetVisual(_THIS, Display *display, int screen)