internal/ui: bug fix: setting a size failed for an invisible window

Updates #2725
Closes #2951
This commit is contained in:
Hajime Hoshi 2024-04-06 22:25:53 +09:00
parent bb57fe8e15
commit d6f7b50387

View File

@ -1027,10 +1027,14 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
return err return err
} }
// Window is shown after the first buffer swap. // Window is shown after the first buffer swap (#2725).
// On Linux or UNIX, there is a problematic desktop environment like i3wm
// where an invisible window size cannot be initialized correctly (#2951).
if runtime.GOOS == "darwin" || runtime.GOOS == "windows" {
if err := glfw.WindowHint(glfw.Visible, glfw.False); err != nil { if err := glfw.WindowHint(glfw.Visible, glfw.False); err != nil {
return err return err
} }
}
if err := glfw.WindowHintString(glfw.X11ClassName, options.X11ClassName); err != nil { if err := glfw.WindowHintString(glfw.X11ClassName, options.X11ClassName); err != nil {
return err return err