internal/glfwwin: ignore the error at SetProcessDpiAwarenessContext

Updates #2113
This commit is contained in:
Hajime Hoshi 2022-06-01 23:11:04 +09:00
parent 285a5cbc69
commit 432365ff92

View File

@ -241,9 +241,9 @@ func platformInit() error {
if isWindows10CreatorsUpdateOrGreaterWin32() { if isWindows10CreatorsUpdateOrGreaterWin32() {
if !microsoftgdk.IsXbox() { if !microsoftgdk.IsXbox() {
if err := _SetProcessDpiAwarenessContext(_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); err != nil && !errors.Is(err, windows.ERROR_ACCESS_DENIED) { // Ignore the error as SetProcessDpiAwarenessContext returns an error on Steam Deck (#2113).
return err // This seems an issue in Wine and/or Proton, but there is nothing we can do.
} _ = _SetProcessDpiAwarenessContext(_DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2)
} }
} else if _IsWindows8Point1OrGreater() { } else if _IsWindows8Point1OrGreater() {
if err := _SetProcessDpiAwareness(_PROCESS_PER_MONITOR_DPI_AWARE); err != nil && !errors.Is(err, windows.ERROR_ACCESS_DENIED) { if err := _SetProcessDpiAwareness(_PROCESS_PER_MONITOR_DPI_AWARE); err != nil && !errors.Is(err, windows.ERROR_ACCESS_DENIED) {