internal/uidriver/glfw: refactoring: remove initTitle

This commit is contained in:
Hajime Hoshi 2021-12-29 22:26:56 +09:00
parent 5ee2ff56ca
commit 220a8f48ac
2 changed files with 3 additions and 16 deletions

View File

@ -86,7 +86,6 @@ type UserInterface struct {
initFullscreenWidthInDIP int initFullscreenWidthInDIP int
initFullscreenHeightInDIP int initFullscreenHeightInDIP int
initTitle string
initFullscreen bool initFullscreen bool
initCursorMode driver.CursorMode initCursorMode driver.CursorMode
initWindowDecorated bool initWindowDecorated bool
@ -284,19 +283,6 @@ func (u *UserInterface) setWindowSizeLimitsInDIP(minw, minh, maxw, maxh int) boo
return true return true
} }
func (u *UserInterface) getInitTitle() string {
u.m.RLock()
v := u.initTitle
u.m.RUnlock()
return v
}
func (u *UserInterface) setInitTitle(title string) {
u.m.RLock()
u.initTitle = title
u.m.RUnlock()
}
func (u *UserInterface) isInitFullscreen() bool { func (u *UserInterface) isInitFullscreen() bool {
u.m.RLock() u.m.RLock()
v := u.initFullscreen v := u.initFullscreen
@ -927,7 +913,6 @@ func (u *UserInterface) init() error {
u.window.Maximize() u.window.Maximize()
} }
u.title = u.getInitTitle()
u.window.SetTitle(u.title) u.window.SetTitle(u.title)
u.window.Show() u.window.Show()

View File

@ -258,7 +258,9 @@ func (w *window) SetIcon(iconImages []image.Image) {
func (w *window) SetTitle(title string) { func (w *window) SetTitle(title string) {
if !w.ui.isRunning() { if !w.ui.isRunning() {
w.ui.setInitTitle(title) w.ui.m.Lock()
w.ui.title = title
w.ui.m.Unlock()
return return
} }
w.ui.title = title w.ui.title = title