From 75a024e40e08d6234e1feef6f915869d3e0984f9 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Fri, 4 Jan 2019 05:58:32 +0900 Subject: [PATCH] devicescale: Bug fix: GetWindowDC returns error on Wine Fixes #743 --- internal/devicescale/impl_windows.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/devicescale/impl_windows.go b/internal/devicescale/impl_windows.go index 8c828b7d5..498e43ce9 100644 --- a/internal/devicescale/impl_windows.go +++ b/internal/devicescale/impl_windows.go @@ -190,8 +190,8 @@ func getDpiForMonitor(hMonitor uintptr, dpiType uintptr, dpiX, dpiY uintptr) err func getFromLogPixelSx() float64 { dc, err := getWindowDC(0) if err != nil { - // On Wine, it looks like GetWindowDC(0) doesn't work (#738). - if err.(*winErr).Code == 1400 { + // On Wine, it looks like GetWindowDC(0) doesn't work (#738, #743). + if code := err.(*winErr).Code; code == 1400 || code == 1812 { return 1 } panic(err)