mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
058973adda
commit
acd317bf91
@ -1358,20 +1358,32 @@ func (u *UserInterface) update() (float64, float64, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for !u.isRunnableOnUnfocused() {
|
||||||
// In the initial state on macOS, the window is not shown (#2620).
|
// In the initial state on macOS, the window is not shown (#2620).
|
||||||
visible, err := u.window.GetAttrib(glfw.Visible)
|
visible, err := u.window.GetAttrib(glfw.Visible)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
|
if visible == glfw.False {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
focused, err := u.window.GetAttrib(glfw.Focused)
|
focused, err := u.window.GetAttrib(glfw.Focused)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
|
if focused != glfw.False {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
shouldClose, err := u.window.ShouldClose()
|
shouldClose, err := u.window.ShouldClose()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
for visible != 0 && !u.isRunnableOnUnfocused() && focused == 0 && !shouldClose {
|
if shouldClose {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
if err := hook.SuspendAudio(); err != nil {
|
if err := hook.SuspendAudio(); err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
@ -1381,6 +1393,7 @@ func (u *UserInterface) update() (float64, float64, error) {
|
|||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := hook.ResumeAudio(); err != nil {
|
if err := hook.ResumeAudio(); err != nil {
|
||||||
return 0, 0, err
|
return 0, 0, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user