internal/uidriver/glfw: Bug fix: setWindowSize could not accept a fullscreen size

This commit is contained in:
Hajime Hoshi 2021-04-20 20:09:04 +09:00
parent ee8bfcd837
commit 47f569e473

View File

@ -1365,9 +1365,13 @@ func (u *UserInterface) maximizeWindow() {
u.window.Maximize() u.window.Maximize()
// Call setWindowSize explicitly in order to update the rendering since the callback is disabled now. // 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() {
w, h := u.window.GetSize() w, h := u.window.GetSize()
u.setWindowSize(w, h, u.isFullscreen()) u.setWindowSize(w, h, u.isFullscreen())
} }
}
// iconifyWindow must be called from the main thread. // iconifyWindow must be called from the main thread.
func (u *UserInterface) iconifyWindow() { func (u *UserInterface) iconifyWindow() {
@ -1394,9 +1398,13 @@ func (u *UserInterface) restoreWindow() {
u.window.Restore() u.window.Restore()
// Call setWindowSize explicitly in order to update the rendering since the callback is disabled now. // 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() {
w, h := u.window.GetSize() w, h := u.window.GetSize()
u.setWindowSize(w, h, u.isFullscreen()) u.setWindowSize(w, h, u.isFullscreen())
} }
}
// setWindowDecorated must be called from the main thread. // setWindowDecorated must be called from the main thread.
func (u *UserInterface) setWindowDecorated(decorated bool) { func (u *UserInterface) setWindowDecorated(decorated bool) {
@ -1469,9 +1477,13 @@ func (u *UserInterface) setWindowPosition(x, y int) {
// Call setWindowSize explicitly in order to update the rendering since the callback is disabled now. // Call setWindowSize explicitly in order to update the rendering since the callback is disabled now.
// This is necessary in some very limited cases (#1606). // This is necessary in some very limited cases (#1606).
// 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() {
w, h := u.window.GetSize() w, h := u.window.GetSize()
u.setWindowSize(w, h, u.isFullscreen()) u.setWindowSize(w, h, u.isFullscreen())
} }
}
// setWindowTitle must be called from the main thread. // setWindowTitle must be called from the main thread.
func (u *UserInterface) setWindowTitle(title string) { func (u *UserInterface) setWindowTitle(title string) {