From 90accfba1e7e868b6d1231aec4ecdcca983f7ce4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 15 Sep 2023 03:11:35 +0900 Subject: [PATCH] internal/ui: bug fix: do not call PollEvents on Windows and Linux Updates #2296 --- internal/ui/ui_glfw.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index cda3a2b75..600df71d9 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -1514,7 +1514,10 @@ func (u *userInterfaceImpl) setFullscreen(fullscreen bool) { } // glfw.PollEvents is necessary for macOS to enable (*glfw.Window).SetPos and SetSize (#2296). - glfw.PollEvents() + // This polling causes issues on Linux and Windows when rapidly toggling fullscreen, so we only run it under macOS. + if runtime.GOOS == "darwin" { + glfw.PollEvents() + } if origX != invalidPos && origY != invalidPos { u.window.SetPos(origX, origY)