mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/uidriver/js: Bug fix: SetFullscreen didn't work on Safari
Updates #1611
This commit is contained in:
parent
5d3a76cbe6
commit
b509ce523d
@ -102,7 +102,6 @@ func (u *UserInterface) SetFullscreen(fullscreen bool) {
|
|||||||
f := canvas.Get("requestFullscreen")
|
f := canvas.Get("requestFullscreen")
|
||||||
if !f.Truthy() {
|
if !f.Truthy() {
|
||||||
f = canvas.Get("webkitRequestFullscreen")
|
f = canvas.Get("webkitRequestFullscreen")
|
||||||
return
|
|
||||||
}
|
}
|
||||||
f.Call("bind", canvas).Invoke()
|
f.Call("bind", canvas).Invoke()
|
||||||
return
|
return
|
||||||
@ -422,11 +421,15 @@ func init() {
|
|||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
document.Call("addEventListener", "pointerlockerror", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
document.Call("addEventListener", "pointerlockerror", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
js.Global().Get("console").Call("error", "pointerlockerror event is fired. 'sandbox=\"allow-pointer-lock\"' might be required. There is a known issue on Safari (hajimehoshi/ebiten#1604)")
|
js.Global().Get("console").Call("error", "pointerlockerror event is fired. 'sandbox=\"allow-pointer-lock\"' might be required at an iframe. This function on browsers must be called as a result of a gestural interaction or orientation change.")
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
document.Call("addEventListener", "fullscreenerror", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
document.Call("addEventListener", "fullscreenerror", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
js.Global().Get("console").Call("error", "fullscreenerror event is fired. This function on browsers must be called as a result of a gestural interaction or orientation change.")
|
js.Global().Get("console").Call("error", "fullscreenerror event is fired. 'sandbox=\"fullscreen\"' might be required at an iframe. This function on browsers must be called as a result of a gestural interaction or orientation change.")
|
||||||
|
return nil
|
||||||
|
}))
|
||||||
|
document.Call("addEventListener", "webkitfullscreenerror", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
|
js.Global().Get("console").Call("error", "webkitfullscreenerror event is fired. 'sandbox=\"fullscreen\"' might be required at an iframe. This function on browsers must be called as a result of a gestural interaction or orientation change.")
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user