From ac08ebe0804ede2cc674dadccfb3dde4e9cfec9d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 29 Oct 2022 17:47:31 +0900 Subject: [PATCH] internal/ui: set SwapInterval(0) when resizing the window This mitigates flickering at least on macOS with OpenGL. Updates #2144 --- internal/ui/ui_glfw.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index cd5cf45f5..c5bf9a384 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -773,7 +773,13 @@ func (u *userInterfaceImpl) registerWindowSetSizeCallback() { } if u.graphicsDriver.IsGL() { + glfw.SwapInterval(0) u.swapBuffers() + if u.fpsMode == FPSModeVsyncOn { + glfw.SwapInterval(1) + } else { + glfw.SwapInterval(0) + } } u.forceToRefreshIfNeeded()