diff --git a/ui/app/egl.go b/ui/app/egl.go index ee07993e..8a0d9d79 100644 --- a/ui/app/egl.go +++ b/ui/app/egl.go @@ -256,6 +256,12 @@ func createSurfaceAndMakeCurrent(eglCtx *eglContext, win _EGLNativeWindowType) ( } surfAttribs = append(surfAttribs, _EGL_NONE) eglSurf := eglCreateWindowSurface(eglCtx.disp, eglCtx.config, win, surfAttribs) + if eglSurf == nilEGLSurface && eglCtx.srgb { + // Try again without sRGB + eglCtx.srgb = false + surfAttribs = []_EGLint{_EGL_NONE} + eglSurf = eglCreateWindowSurface(eglCtx.disp, eglCtx.config, win, surfAttribs) + } if eglSurf == nilEGLSurface { return nilEGLSurface, fmt.Errorf("newContext: eglCreateWindowSurface failed 0x%x (sRGB=%v)", eglGetError(), eglCtx.srgb) }