mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/uidriver/glfw: Bug fix: Crash at Restore
This is the same reason as Maximize. Updates #1576
This commit is contained in:
parent
37944d67c4
commit
d6ab27a5a2
@ -1308,3 +1308,15 @@ func (u *UserInterface) maximize() {
|
||||
w, h := u.window.GetSize()
|
||||
u.setWindowSize(w, h, u.isFullscreen())
|
||||
}
|
||||
|
||||
func (u *UserInterface) restore() {
|
||||
// Restore invokes the SetSize callback but the callback must not be called in the game's Update (#1576).
|
||||
if u.unregisterWindowSetSizeCallback() {
|
||||
defer u.registerWindowSetSizeCallback()
|
||||
}
|
||||
u.window.Restore()
|
||||
|
||||
// Call setWindowSize explicitly in order to update the rendering since the callback is unregistered now.
|
||||
w, h := u.window.GetSize()
|
||||
u.setWindowSize(w, h, u.isFullscreen())
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ func (w *window) Restore() {
|
||||
return
|
||||
}
|
||||
_ = w.ui.t.Call(func() error {
|
||||
w.ui.window.Restore()
|
||||
w.ui.restore()
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user