From 76da09f74c538de3a478386468af20643b316df8 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 30 Jun 2017 02:14:14 +0900 Subject: [PATCH] ui: Bug fix: Window title might lost on macOS (#267) --- internal/ui/ui_glfw.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 88e30816d..8782b274f 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -30,6 +30,7 @@ import ( ) type userInterface struct { + title string window *glfw.Window width 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) { return errors.New("ui: Fail to set the screen size") } + u.title = title u.window.SetTitle(title) u.window.Show() @@ -402,6 +404,8 @@ func (u *userInterface) setScreenSize(width, height int, scale float64, fullscre default: } } + // Window title might lost on macOS after coming back from fullscreen. + u.window.SetTitle(u.title) } // TODO: Rename this variable? u.sizeChanged = true