mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-11 19:48:54 +01:00
internal/uidriver/glfw: Bug fix: Defer SetIcon on the fullscreen mode
Closes #1587
This commit is contained in:
parent
7e61189c3d
commit
fd80583dd0
@ -956,7 +956,9 @@ func (u *UserInterface) loop() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if imgs := u.getIconImages(); imgs != nil {
|
// Create icon images in a different goroutine (#1478).
|
||||||
|
// On the fullscreen mode, SetIcon fails (#1578).
|
||||||
|
if imgs := u.getIconImages(); imgs != nil && !u.isFullscreen() {
|
||||||
u.setIconImages(nil)
|
u.setIconImages(nil)
|
||||||
|
|
||||||
// Convert the icons in the different goroutine, as (*ebiten.Image).At cannot be invoked
|
// Convert the icons in the different goroutine, as (*ebiten.Image).At cannot be invoked
|
||||||
@ -979,6 +981,11 @@ func (u *UserInterface) loop() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_ = u.t.Call(func() error {
|
_ = u.t.Call(func() error {
|
||||||
|
// On the fullscreen mode, reset the icon images and try again later.
|
||||||
|
if u.isFullscreen() {
|
||||||
|
u.setIconImages(imgs)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
u.window.SetIcon(newImgs)
|
u.window.SetIcon(newImgs)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user