internal/ui: bug fix: MaximizeWindow before Run caused an unexpected error on Windows

Closes #2137
This commit is contained in:
Hajime Hoshi 2022-06-13 12:28:17 +09:00
parent aef5402831
commit 44cfb92cee

View File

@ -678,10 +678,6 @@ func (u *userInterfaceImpl) createWindow(width, height int) error {
u.window.SetTitle(u.title)
// Icons are set after every frame. They don't have to be cared here.
u.registerWindowSetSizeCallback()
u.registerWindowCloseCallback()
u.registerWindowFramebufferSizeCallback()
u.updateWindowSizeLimits()
return nil
@ -924,6 +920,12 @@ func (u *userInterfaceImpl) init() error {
gamepad.SetNativeWindow(u.nativeWindow())
// Register callbacks after the window initialization done.
// The callback might cause swapping frames, that assumes the window is already set (#2137).
u.registerWindowSetSizeCallback()
u.registerWindowCloseCallback()
u.registerWindowFramebufferSizeCallback()
return nil
}