diff --git a/app/internal/window/egl.go b/app/internal/window/egl.go index a301bc15..01e1e9a4 100644 --- a/app/internal/window/egl.go +++ b/app/internal/window/egl.go @@ -142,34 +142,29 @@ func (c *context) MakeCurrent() error { return nil } c.width, c.height = width, height - // Do not re-create surfaces when only resizing. This prevents flickering when resizing on X11. - if c.eglWin != win { - if win == nilEGLNativeWindowType && c.srgbFBO != nil { - c.srgbFBO.Release() - c.srgbFBO = nil - } - c.destroySurface() - c.eglWin = win - if c.eglWin == nilEGLNativeWindowType { - return nil - } - eglSurf, err := createSurfaceAndMakeCurrent(c.eglCtx, win) - c.eglSurf = eglSurf - if err != nil { - c.eglWin = nilEGLNativeWindowType - return err - } - // eglSwapInterval 1 leads to erratic frame rates and unnecessary blocking. - // We rely on platform specific frame rate limiting instead, except on Windows - // and X11 where eglSwapInterval is all there is. - if c.driver.needVSync() { - eglSwapInterval(c.eglCtx.disp, 1) - } else { - eglSwapInterval(c.eglCtx.disp, 0) - } - } else if c.eglWin == nilEGLNativeWindowType { + if win == nilEGLNativeWindowType && c.srgbFBO != nil { + c.srgbFBO.Release() + c.srgbFBO = nil + } + c.destroySurface() + c.eglWin = win + if c.eglWin == nilEGLNativeWindowType { return nil } + eglSurf, err := createSurfaceAndMakeCurrent(c.eglCtx, win) + c.eglSurf = eglSurf + if err != nil { + c.eglWin = nilEGLNativeWindowType + return err + } + // eglSwapInterval 1 leads to erratic frame rates and unnecessary blocking. + // We rely on platform specific frame rate limiting instead, except on Windows + // and X11 where eglSwapInterval is all there is. + if c.driver.needVSync() { + eglSwapInterval(c.eglCtx.disp, 1) + } else { + eglSwapInterval(c.eglCtx.disp, 0) + } if c.eglCtx.srgb { return nil }