From f5a42164349a0c48072e04cae8664dde49096748 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 18 Apr 2021 21:06:02 +0900 Subject: [PATCH] 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 --- internal/uidriver/glfw/ui.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/uidriver/glfw/ui.go b/internal/uidriver/glfw/ui.go index 3827dbf17..e013ed3e4 100644 --- a/internal/uidriver/glfw/ui.go +++ b/internal/uidriver/glfw/ui.go @@ -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() {