From 6167cc4f548adc17015e85080f64bd52e280e27b Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 25 Sep 2022 18:19:18 +0900 Subject: [PATCH] internal/ui: remove unnecessary function calls updateSize was introduced at 7eff5cbd4aaecf02f9736971e793436c24e294b9, but apparently calling setWindowSizeInDIP was originally not needed. --- internal/ui/ui_glfw.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index 6533e4d3e..fd8c8965d 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -752,7 +752,6 @@ func (u *userInterfaceImpl) registerWindowSetSizeCallback() { u.setWindowSizeInDIP(w, h, u.isFullscreen()) } - u.updateSize() outsideWidth, outsideHeight := u.outsideSize() deviceScaleFactor := u.deviceScaleFactor(u.currentMonitor()) @@ -978,10 +977,6 @@ func (u *userInterfaceImpl) init() error { return nil } -func (u *userInterfaceImpl) updateSize() { - u.setWindowSizeInDIP(u.origWindowWidthInDIP, u.origWindowHeightInDIP, u.isFullscreen()) -} - func (u *userInterfaceImpl) outsideSize() (float64, float64) { if u.isFullscreen() && !u.isNativeFullscreen() { // 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). // Also, when toggling to fullscreen, vsync state might be reset unexpectedly (#1787). u.updateVsync() - u.updateSize() if u.fpsMode != FPSModeVsyncOffMinimum { // TODO: Updating the input can be skipped when clock.Update returns 0 (#1367).