internal/ui: bug fix: make the window resizable after the window is created

Making the window resizable BEFORE the window is created doesn't
work correctly, especially when switching to enable resizing later.

Closes #1987
This commit is contained in:
Hajime Hoshi 2022-02-10 00:53:18 +09:00
parent 7f569f3071
commit 6443af6401

View File

@ -900,11 +900,9 @@ func (u *UserInterface) init() error {
glfw.WindowHint(glfw.TransparentFramebuffer, transparent)
u.Graphics().SetTransparent(u.isInitScreenTransparent())
resizable := glfw.False
if u.isInitWindowResizable() {
resizable = glfw.True
}
glfw.WindowHint(glfw.Resizable, resizable)
// Before creating a window, set it unresizable no matter what u.isInitWindowResizable() is (#1987).
// Making the window resizable here doesn't work correctly when switching to enable resizing.
glfw.WindowHint(glfw.Resizable, glfw.False)
floating := glfw.False
if u.isInitWindowFloating() {
@ -948,6 +946,8 @@ func (u *UserInterface) init() error {
u.updateWindowSizeLimits()
u.setWindowResizable(u.isInitWindowResizable())
// Maximizing a window requires a proper size and position. Call Maximize here (#1117).
if u.isInitWindowMaximized() {
u.window.Maximize()