mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
ui: Bug fix: userInterface.fullscreen() must be called from the main thread
This commit is contained in:
parent
b58dc26832
commit
78a58fd1ae
@ -247,6 +247,7 @@ func ScreenScale() float64 {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fullscreen must be called from the main thread.
|
||||||
func (u *userInterface) fullscreen() bool {
|
func (u *userInterface) fullscreen() bool {
|
||||||
if !u.isRunning() {
|
if !u.isRunning() {
|
||||||
panic("not reached")
|
panic("not reached")
|
||||||
@ -259,7 +260,12 @@ func IsFullscreen() bool {
|
|||||||
if !u.isRunning() {
|
if !u.isRunning() {
|
||||||
return u.isInitFullscreen()
|
return u.isInitFullscreen()
|
||||||
}
|
}
|
||||||
return u.fullscreen()
|
b := false
|
||||||
|
_ = u.runOnMainThread(func() error {
|
||||||
|
b = u.fullscreen()
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetFullscreen(fullscreen bool) {
|
func SetFullscreen(fullscreen bool) {
|
||||||
|
Loading…
Reference in New Issue
Block a user