diff --git a/internal/ui/ui_glfw.go b/internal/ui/ui_glfw.go index a8ec927dd..8b5138177 100644 --- a/internal/ui/ui_glfw.go +++ b/internal/ui/ui_glfw.go @@ -789,18 +789,18 @@ func (u *userInterfaceImpl) createWindow() error { mw := int(u.dipFromGLFWMonitorPixel(float64(monitor.videoMode.Width), monitor)) mh := int(u.dipFromGLFWMonitorPixel(float64(monitor.videoMode.Height), monitor)) // Force to put the window in the initial monitor (#1575). - if wx < 0 { - wx = 0 - } - if wy < 0 { - wy = 0 - } if max := mw - ww; wx >= max { wx = max } if max := mh - wh; wy >= max { wy = max } + if wx < 0 { + wx = 0 + } + if wy < 0 { + wy = 0 + } u.setWindowPositionInDIP(wx, wy, monitor) // Though the size is already specified, call setWindowSizeInDIP explicitly to adjust member variables.