ui: Bug fix: Window title might lost on macOS (#267)

This commit is contained in:
Hajime Hoshi 2017-06-30 02:14:14 +09:00
parent 64ed7b93f6
commit 76da09f74c

View File

@ -30,6 +30,7 @@ import (
) )
type userInterface struct { type userInterface struct {
title string
window *glfw.Window window *glfw.Window
width int width int
height int height int
@ -218,6 +219,7 @@ func Run(width, height int, scale float64, title string, g GraphicsContext) erro
if !u.setScreenSize(width, height, scale, false) { if !u.setScreenSize(width, height, scale, false) {
return errors.New("ui: Fail to set the screen size") return errors.New("ui: Fail to set the screen size")
} }
u.title = title
u.window.SetTitle(title) u.window.SetTitle(title)
u.window.Show() u.window.Show()
@ -402,6 +404,8 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre
default: default:
} }
} }
// Window title might lost on macOS after coming back from fullscreen.
u.window.SetTitle(u.title)
} }
// TODO: Rename this variable? // TODO: Rename this variable?
u.sizeChanged = true u.sizeChanged = true