internal/ui: refactoring: call updateWindowSizeLimits in createWindow

This commit is contained in:
Hajime Hoshi 2022-02-08 16:06:12 +09:00
parent 4c6c31e384
commit 6dbc5ba558

View File

@ -708,6 +708,8 @@ func (u *UserInterface) createWindow() error {
u.registerWindowCloseCallback() u.registerWindowCloseCallback()
u.registerWindowFramebufferSizeCallback() u.registerWindowFramebufferSizeCallback()
u.updateWindowSizeLimits()
return nil return nil
} }
@ -906,8 +908,6 @@ func (u *UserInterface) init() error {
ww, wh := u.getInitWindowSizeInDIP() ww, wh := u.getInitWindowSizeInDIP()
u.setWindowSizeInDIP(ww, wh, u.isFullscreen()) u.setWindowSizeInDIP(ww, wh, u.isFullscreen())
u.updateWindowSizeLimits()
// Maximizing a window requires a proper size and position. Call Maximize here (#1117). // Maximizing a window requires a proper size and position. Call Maximize here (#1117).
if u.isInitWindowMaximized() { if u.isInitWindowMaximized() {
u.window.Maximize() u.window.Maximize()
@ -1273,8 +1273,6 @@ func (u *UserInterface) setWindowSizeInDIPImpl(width, height int, fullscreen boo
// TODO: This should return an error. // TODO: This should return an error.
panic(fmt.Sprintf("ui: failed to recreate window: %v", err)) panic(fmt.Sprintf("ui: failed to recreate window: %v", err))
} }
// Reset the size limits explicitly.
u.updateWindowSizeLimits()
u.window.Show() u.window.Show()
windowRecreated = true windowRecreated = true
} }