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 cf5b851cd3
commit 3136de4958

View File

@ -1027,9 +1027,13 @@ func (u *UserInterface) initOnMainThread(options *RunOptions) error {
return err
}
// Window is shown after the first buffer swap.
if err := glfw.WindowHint(glfw.Visible, glfw.False); err != nil {
return err
// 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 {
return err
}
}
if err := glfw.WindowHintString(glfw.X11ClassName, options.X11ClassName); err != nil {