mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 11:48:55 +01:00
parent
db40554715
commit
38f49c3768
@ -77,8 +77,7 @@ func (u *UserInterface) IsFullscreen() bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (u *UserInterface) IsForeground() bool {
|
func (u *UserInterface) IsForeground() bool {
|
||||||
// TODO: implement this
|
return u.isForeground()
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UserInterface) SetRunnableInBackground(runnableInBackground bool) {
|
func (u *UserInterface) SetRunnableInBackground(runnableInBackground bool) {
|
||||||
@ -146,14 +145,17 @@ func (u *UserInterface) suspended() bool {
|
|||||||
if u.runnableInBackground {
|
if u.runnableInBackground {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
return !u.isForeground()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *UserInterface) isForeground() bool {
|
||||||
if !document.Call("hasFocus").Bool() {
|
if !document.Call("hasFocus").Bool() {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
if document.Get("hidden").Bool() {
|
if document.Get("hidden").Bool() {
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
return false
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *UserInterface) update() error {
|
func (u *UserInterface) update() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user