diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 78a99a287..de0afbdf1 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -289,6 +289,11 @@ func (u *userInterfaceImpl) setWindowSizeLimitsInDIP(minw, minh, maxw, maxh int) return true } +func (u *userInterfaceImpl) areWindowSizeLimitsSpecified() bool { + minw, minh, maxw, maxh := u.getWindowSizeLimitsInDIP() + return minw != glfw.DontCare || minh != glfw.DontCare || maxw != glfw.DontCare || maxh != glfw.DontCare +} + func (u *userInterfaceImpl) isInitFullscreen() bool { u.m.RLock() v := u.initFullscreen diff --git a/internal/ui/window_glfw.go b/internal/ui/window_glfw.go index cd83cffb5..401756a98 100644 --- a/internal/ui/window_glfw.go +++ b/internal/ui/window_glfw.go @@ -119,8 +119,7 @@ func (w *glfwWindow) Maximize() { return } - minw, minh, maxw, maxh := w.ui.getWindowSizeLimitsInDIP() - if minw != glfw.DontCare || minh != glfw.DontCare || maxw != glfw.DontCare || maxh != glfw.DontCare { + if w.ui.areWindowSizeLimitsSpecified() { return } @@ -151,6 +150,9 @@ func (w *glfwWindow) Minimize() { } func (w *glfwWindow) Restore() { + if w.ui.areWindowSizeLimitsSpecified() { + return + } if !w.ui.isRunning() { // Do nothing return