diff --git a/CHANGELOG.md b/CHANGELOG.md index bed8265ab8..c4428df67e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Added `NotCurrentContext::make_current_surfaceless(self)` and `PossiblyCurrentContext::make_current_surfaceless(&self)` in the `Wgl` implementation to allow the use of surfaceless contexts with WGL. +- Added workaround for EGL drivers reporting `EGL_KHR_platform_gbm` without EGL 1.5 client. # Version 0.32.1 diff --git a/glutin/src/api/egl/display.rs b/glutin/src/api/egl/display.rs index 4c2454d467..f392fce848 100644 --- a/glutin/src/api/egl/display.rs +++ b/glutin/src/api/egl/display.rs @@ -362,7 +362,16 @@ impl Display { handle.connection.map_or(egl::DEFAULT_DISPLAY as *mut _, |c| c.as_ptr()), ) }, - RawDisplayHandle::Gbm(handle) if extensions.contains("EGL_MESA_platform_gbm") => { + RawDisplayHandle::Gbm(handle) + // NOTE: Some drivers report that they support the KHR GBM extension without EGL + // 1.5 client, so work around that here by checking the KHR GBM extension as well. + // The MESA and KHR extensions have the same constant values, thus it'll work + // regardless. + // + // See https://github.com/rust-windowing/glutin/issues/1708. + if extensions.contains("EGL_MESA_platform_gbm") + || extensions.contains("EGL_KHR_platform_gbm") => + { (egl::PLATFORM_GBM_MESA, handle.gbm_device.as_ptr()) }, RawDisplayHandle::Drm(_) => {