mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/ui: bug fix: an unfocused window should not wait until buffers are swapped once
On macOS, a window is hidden until buffers are swapped once. If a game is not runnable on unfocused, as the window is hidden and unfocused, the waiting loop for a window never ends. This change fixes the issue by changing the loop condition. Closes #2620
This commit is contained in:
parent
f5e0496611
commit
db7c99fde8
@ -1019,7 +1019,7 @@ func (u *userInterfaceImpl) update() (float64, float64, error) {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
||||
for !u.isRunnableOnUnfocused() && u.window.GetAttrib(glfw.Focused) == 0 && !u.window.ShouldClose() {
|
||||
for u.bufferOnceSwapped && !u.isRunnableOnUnfocused() && u.window.GetAttrib(glfw.Focused) == 0 && !u.window.ShouldClose() {
|
||||
if err := hooks.SuspendAudio(); err != nil {
|
||||
return 0, 0, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user