From 02919866586961ba71816118f07bb0f167fe1155 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Thu, 10 Feb 2022 00:53:18 +0900 Subject: [PATCH] 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 --- internal/ui/ui_glfw.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index edf52103b..ff5d5e82f 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -885,11 +885,9 @@ func (u *UserInterface) init() error { glfw.WindowHint(glfw.TransparentFramebuffer, transparent) 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() { @@ -924,6 +922,8 @@ func (u *UserInterface) init() error { u.setWindowPositionInDIP(wx, wy, u.initMonitor) u.setWindowSizeInDIP(ww, wh, u.isFullscreen()) + u.setWindowResizable(u.isInitWindowResizable()) + // Maximizing a window requires a proper size and position. Call Maximize here (#1117). if u.isInitWindowMaximized() { u.window.Maximize()