internal/ui: better fix for initialMonitorByOS

Updates #2179
This commit is contained in:
Hajime Hoshi 2022-07-04 14:42:17 +09:00
parent 29b41fd07f
commit e488486d97

View File

@ -170,7 +170,10 @@ func (u *userInterfaceImpl) adjustWindowPosition(x, y int, monitor *glfw.Monitor
func initialMonitorByOS() (*glfw.Monitor, error) {
px, py, err := getCursorPos()
if err != nil && !errors.Is(err, windows.ERROR_ACCESS_DENIED) {
if err != nil {
if errors.Is(err, windows.ERROR_ACCESS_DENIED) {
return nil, nil
}
return nil, err
}
x, y := int(px), int(py)