internal/ui: bug fix: wait for a while after exiting fullscreen on macOS

Closes #2758
This commit is contained in:
Hajime Hoshi 2023-09-15 03:19:33 +09:00
parent 90accfba1e
commit b710ff17c8

View File

@ -367,6 +367,14 @@ func (u *userInterfaceImpl) setWindowMonitor(monitor int) {
// This is copied from setFullscreen. They should probably use a shared function. // This is copied from setFullscreen. They should probably use a shared function.
if fullscreen { if fullscreen {
u.setFullscreen(false) u.setFullscreen(false)
// Just after exiting fullscreen, the window state seems very unstable (#2758).
// Wait for a while with polling events.
if runtime.GOOS == "darwin" {
for i := 0; i < 60; i++ {
glfw.PollEvents()
time.Sleep(time.Second / 60)
}
}
} }
x, y := m.GetPos() x, y := m.GetPos()