internal/ui: change the initial window position adjustment

The window position should be posible if possible.
This commit is contained in:
Hajime Hoshi 2023-09-24 19:07:09 +09:00
parent a23efac01c
commit b5d0dc3686

View File

@ -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.