mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: refactoring
This commit is contained in:
parent
b5196a5a7c
commit
4104abdf77
@ -1470,6 +1470,7 @@ func (u *userInterfaceImpl) Window() Window {
|
||||
|
||||
// maximizeWindow must be called from the main thread.
|
||||
func (u *userInterfaceImpl) maximizeWindow() {
|
||||
// TODO: Can we remove this condition?
|
||||
if u.isNativeFullscreen() {
|
||||
return
|
||||
}
|
||||
@ -1482,7 +1483,10 @@ func (u *userInterfaceImpl) maximizeWindow() {
|
||||
}
|
||||
u.window.Maximize()
|
||||
|
||||
if !u.isFullscreen() {
|
||||
if u.isFullscreen() {
|
||||
return
|
||||
}
|
||||
|
||||
// On Linux/UNIX, maximizing might not finish even though Maximize returns. Just wait for its finish.
|
||||
// Do not check this in the fullscreen since apparently the condition can never be true.
|
||||
for u.window.GetAttrib(glfw.Maximized) != glfw.True {
|
||||
@ -1497,10 +1501,10 @@ func (u *userInterfaceImpl) maximizeWindow() {
|
||||
wh := int(u.dipFromGLFWPixel(float64(h), u.currentMonitor()))
|
||||
u.setWindowSizeInDIP(ww, wh, u.isFullscreen())
|
||||
}
|
||||
}
|
||||
|
||||
// iconifyWindow must be called from the main thread.
|
||||
func (u *userInterfaceImpl) iconifyWindow() {
|
||||
// Iconifying a native fullscreen window on macOS is forbidden.
|
||||
if u.isNativeFullscreen() {
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user