mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/uidriver/glfw: Bug fix: Crash at Iconify
This is the same reason as Maximize. Updates #1576
This commit is contained in:
parent
b5d4c834b8
commit
f09cf7fa47
@ -1322,7 +1322,7 @@ func (u *UserInterface) Window() driver.Window {
|
||||
}
|
||||
|
||||
func (u *UserInterface) maximize() {
|
||||
// Maximizing invokes the SetSize callback but the callback must not be called in the game's Update (#1576).
|
||||
// Maximize invokes the SetSize callback but the callback must not be called in the game's Update (#1576).
|
||||
if u.unregisterWindowSetSizeCallback() {
|
||||
defer u.registerWindowSetSizeCallback()
|
||||
}
|
||||
@ -1333,6 +1333,18 @@ func (u *UserInterface) maximize() {
|
||||
u.setWindowSize(w, h, u.isFullscreen())
|
||||
}
|
||||
|
||||
func (u *UserInterface) iconify() {
|
||||
// Iconify 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.Iconify()
|
||||
|
||||
// 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())
|
||||
}
|
||||
|
||||
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() {
|
||||
|
@ -159,7 +159,7 @@ func (w *window) Minimize() {
|
||||
return
|
||||
}
|
||||
_ = w.ui.t.Call(func() error {
|
||||
w.ui.window.Iconify()
|
||||
w.ui.iconify()
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user