mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/ui: forbide RestoreWindow when the window size limits are specified
Closes #2259
This commit is contained in:
parent
31141d5112
commit
833473316f
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user