mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: bug fix: MaximizeWindow before Run caused an unexpected error on Windows
Closes #2137
This commit is contained in:
parent
eb4fe093ed
commit
b176867d07
@ -676,10 +676,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
|
||||
@ -920,6 +916,12 @@ func (u *userInterfaceImpl) init() error {
|
||||
g.SetWindow(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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user