internal/uidriver/glfw: Bug fix: Update vsync every frame

Closes #1787
This commit is contained in:
Hajime Hoshi 2021-08-26 02:01:56 +09:00
parent 7aefac3f5f
commit 74641b1941

View File

@ -910,10 +910,13 @@ func (u *UserInterface) update() (float64, float64, bool, error) {
// Calling this inside setWindowSize didn't work (#1363).
if !u.vsyncInited {
u.vsync = u.isInitVsyncEnabled()
u.updateVsync()
u.vsyncInited = true
}
// Call updateVsync regardless of vsyncInited.
// When toggling to fullscreen, vsync state might be reset unexpectedly (#1787).
u.updateVsync()
outsideWidth, outsideHeight, outsideSizeChanged := u.updateSize()
// TODO: Updating the input can be skipped when clock.Update returns 0 (#1367).