internal/ui: allow maximizeWindow when no max boundaries are set (#2291)

Closes #2290
This commit is contained in:
Kacper Drobny 2022-09-01 15:34:17 +02:00 committed by GitHub
parent 5781943833
commit 9c177c1b8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -289,9 +289,9 @@ 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) isWindowMaximizable() bool {
_, _, maxw, maxh := u.getWindowSizeLimitsInDIP()
return maxw == glfw.DontCare && maxh == glfw.DontCare
}
func (u *userInterfaceImpl) isInitFullscreen() bool {

View File

@ -119,7 +119,7 @@ func (w *glfwWindow) Maximize() {
return
}
if w.ui.areWindowSizeLimitsSpecified() {
if !w.ui.isWindowMaximizable() {
return
}
@ -150,7 +150,7 @@ func (w *glfwWindow) Minimize() {
}
func (w *glfwWindow) Restore() {
if w.ui.areWindowSizeLimitsSpecified() {
if !w.ui.isWindowMaximizable() {
return
}
if !w.ui.isRunning() {