From c5a6ca2aba7615e0d80e3027d142e6e9686f48d8 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 18 Sep 2019 12:35:19 -0400 Subject: [PATCH] ui/app/egl.go: on failure, try again without sRGB Signed-off-by: Drew DeVault --- ui/app/egl.go | 6 ++++++ 1 file changed, 6 insertions(+) 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) }