internal/uidriver/glfw: Bug fix: Do not call setWindowSize on iconifying

The window size might be 0 after iconifying. An iconified window is
invisible to users so setting a window size doesn't make sense anyway.

Closes #1585
This commit is contained in:
Hajime Hoshi 2021-04-18 21:06:02 +09:00
parent 26432dfc9e
commit f5a4216434

View File

@ -1347,9 +1347,8 @@ func (u *UserInterface) iconify() {
}
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())
// After iconifiying, the window is invisible and setWindowSize doesn't have to be called.
// Rather, the window size might be (0, 0) and it might be impossible to call setWindowSize (#1585).
}
func (u *UserInterface) restore() {