mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +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
|
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 {
|
func (u *userInterfaceImpl) isInitFullscreen() bool {
|
||||||
u.m.RLock()
|
u.m.RLock()
|
||||||
v := u.initFullscreen
|
v := u.initFullscreen
|
||||||
|
@ -119,8 +119,7 @@ func (w *glfwWindow) Maximize() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
minw, minh, maxw, maxh := w.ui.getWindowSizeLimitsInDIP()
|
if w.ui.areWindowSizeLimitsSpecified() {
|
||||||
if minw != glfw.DontCare || minh != glfw.DontCare || maxw != glfw.DontCare || maxh != glfw.DontCare {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +150,9 @@ func (w *glfwWindow) Minimize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (w *glfwWindow) Restore() {
|
func (w *glfwWindow) Restore() {
|
||||||
|
if w.ui.areWindowSizeLimitsSpecified() {
|
||||||
|
return
|
||||||
|
}
|
||||||
if !w.ui.isRunning() {
|
if !w.ui.isRunning() {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user