internal/ui: bug fix: do not call PollEvents on Windows and Linux

Updates #2296
This commit is contained in:
Hajime Hoshi 2023-09-15 03:11:35 +09:00
parent 568e98ef1c
commit 90accfba1e

View File

@ -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 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 { if origX != invalidPos && origY != invalidPos {
u.window.SetPos(origX, origY) u.window.SetPos(origX, origY)