internal/ui: optimization: reduce u.t.Call

This commit is contained in:
Hajime Hoshi 2022-03-30 03:28:18 +09:00
parent f2860bebed
commit 172da82aa7

View File

@ -501,15 +501,10 @@ func (u *userInterfaceImpl) SetFullscreen(fullscreen bool) {
return
}
var update bool
u.t.Call(func() {
update = u.isFullscreen() != fullscreen
})
if !update {
if u.isFullscreen() == fullscreen {
return
}
u.t.Call(func() {
w, h := u.windowWidthInDIP, u.windowHeightInDIP
u.setWindowSizeInDIP(w, h, fullscreen)
})