internal/ui: remove unnecessary function calls

updateSize was introduced at 7eff5cbd4a, but
apparently calling setWindowSizeInDIP was originally not needed.
This commit is contained in:
Hajime Hoshi 2022-09-25 18:19:18 +09:00
parent 25405783a7
commit 6167cc4f54

View File

@ -752,7 +752,6 @@ func (u *userInterfaceImpl) registerWindowSetSizeCallback() {
u.setWindowSizeInDIP(w, h, u.isFullscreen()) u.setWindowSizeInDIP(w, h, u.isFullscreen())
} }
u.updateSize()
outsideWidth, outsideHeight := u.outsideSize() outsideWidth, outsideHeight := u.outsideSize()
deviceScaleFactor := u.deviceScaleFactor(u.currentMonitor()) deviceScaleFactor := u.deviceScaleFactor(u.currentMonitor())
@ -978,10 +977,6 @@ func (u *userInterfaceImpl) init() error {
return nil return nil
} }
func (u *userInterfaceImpl) updateSize() {
u.setWindowSizeInDIP(u.origWindowWidthInDIP, u.origWindowHeightInDIP, u.isFullscreen())
}
func (u *userInterfaceImpl) outsideSize() (float64, float64) { func (u *userInterfaceImpl) outsideSize() (float64, float64) {
if u.isFullscreen() && !u.isNativeFullscreen() { if u.isFullscreen() && !u.isNativeFullscreen() {
// On Linux, the window size is not reliable just after making the window // On Linux, the window size is not reliable just after making the window
@ -1062,7 +1057,6 @@ func (u *userInterfaceImpl) update() (float64, float64, error) {
// The vsync state might be changed in other places (e.g., the SetSizeCallback). // The vsync state might be changed in other places (e.g., the SetSizeCallback).
// Also, when toggling to fullscreen, vsync state might be reset unexpectedly (#1787). // Also, when toggling to fullscreen, vsync state might be reset unexpectedly (#1787).
u.updateVsync() u.updateVsync()
u.updateSize()
if u.fpsMode != FPSModeVsyncOffMinimum { if u.fpsMode != FPSModeVsyncOffMinimum {
// TODO: Updating the input can be skipped when clock.Update returns 0 (#1367). // TODO: Updating the input can be skipped when clock.Update returns 0 (#1367).