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 return
} }
var update bool
u.t.Call(func() { u.t.Call(func() {
update = u.isFullscreen() != fullscreen if u.isFullscreen() == fullscreen {
})
if !update {
return return
} }
u.t.Call(func() {
w, h := u.windowWidthInDIP, u.windowHeightInDIP w, h := u.windowWidthInDIP, u.windowHeightInDIP
u.setWindowSizeInDIP(w, h, fullscreen) u.setWindowSizeInDIP(w, h, fullscreen)
}) })