internal/glfwwin: bug fix: do not allow maximizing window when the max size is specified

Closes #2289
This commit is contained in:
Hajime Hoshi 2022-09-01 22:48:36 +09:00
parent 9c177c1b8e
commit 7fab62158d
2 changed files with 9 additions and 1 deletions

View File

@ -28,7 +28,10 @@ func (w *Window) getWindowStyle() uint32 {
if w.decorated { if w.decorated {
style |= _WS_CAPTION style |= _WS_CAPTION
if w.resizable { if w.resizable {
style |= _WS_MAXIMIZEBOX | _WS_THICKFRAME style |= _WS_THICKFRAME
if w.maxwidth == DontCare && w.maxheight == DontCare {
style |= _WS_MAXIMIZEBOX
}
} }
} else { } else {
style |= _WS_POPUP style |= _WS_POPUP

View File

@ -420,6 +420,11 @@ func (w *Window) SetSizeLimits(minwidth, minheight, maxwidth, maxheight int) err
if err := w.platformSetWindowSizeLimits(minwidth, minheight, maxwidth, maxheight); err != nil { if err := w.platformSetWindowSizeLimits(minwidth, minheight, maxwidth, maxheight); err != nil {
return err return err
} }
if err := w.updateWindowStyles(); err != nil {
return err
}
return nil return nil
} }