From b5d0dc36864ba654b9381abb13ca526c5d18dcee Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 24 Sep 2023 19:07:09 +0900 Subject: [PATCH] internal/ui: change the initial window position adjustment The window position should be posible if possible. --- internal/ui/ui_glfw.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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.