mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
internal/uidriver/glfw: Bug fix: A window can never be 'maximized' on fullscreen
When the window is fullscreen, calling MaximizeWindow never returned. Apparently the attribute glfw.Maximized can never be true on the fullscreen mode. This change fixes the issue by checking the fullscreen state.
This commit is contained in:
parent
d24313e236
commit
1013ca9c66
@ -1364,15 +1364,16 @@ func (u *UserInterface) maximizeWindow() {
|
||||
}
|
||||
u.window.Maximize()
|
||||
|
||||
// On Linux/UNIX, maximizing might not finish even though Maximize returns. Just wait for its finish.
|
||||
for u.window.GetAttrib(glfw.Maximized) != glfw.True {
|
||||
glfw.PollEvents()
|
||||
}
|
||||
|
||||
// Call setWindowSize explicitly in order to update the rendering since the callback is disabled now.
|
||||
// Do not call setWindowSize on the fullscreen mode since setWindowSize requires the window size
|
||||
// before the fullscreen, while window.GetSize() returns the desktop screen size on the fullscreen mode.
|
||||
if !u.isFullscreen() {
|
||||
// On Linux/UNIX, maximizing might not finish even though Maximize returns. Just wait for its finish.
|
||||
// Do not check this on the fullscreen since apparently the condition never be true.
|
||||
for u.window.GetAttrib(glfw.Maximized) != glfw.True {
|
||||
glfw.PollEvents()
|
||||
}
|
||||
|
||||
// Call setWindowSize explicitly in order to update the rendering since the callback is disabled now.
|
||||
// Do not call setWindowSize on the fullscreen mode since setWindowSize requires the window size
|
||||
// before the fullscreen, while window.GetSize() returns the desktop screen size on the fullscreen mode.
|
||||
w, h := u.window.GetSize()
|
||||
u.setWindowSize(w, h, u.isFullscreen())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user