diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-31 11:35:09 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-02-24 14:49:48 +0100 |
commit | 620c54ef61999ab4736c269eff028b185cd44de6 (patch) | |
tree | 36436492ffa0d2548388e1eac4d678323bc0629b | |
parent | Merge pull request #113 from zx2c4-forks/jd/arm64 (diff) | |
download | wireguard-windows-620c54ef61999ab4736c269eff028b185cd44de6.tar.xz wireguard-windows-620c54ef61999ab4736c269eff028b185cd44de6.zip |
user32: do more faithful emulation of GetSystemMetricsForDpi for Win<10 on HiDPIpkg/walk-win
-rw-r--r-- | user32.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -7,6 +7,7 @@ package win import ( + "math" "syscall" "unsafe" @@ -2735,7 +2736,7 @@ func GetSystemMetrics(nIndex int32) int32 { func GetSystemMetricsForDpi(nIndex int32, dpi uint32) int32 { if getSystemMetricsForDpi.Find() != nil { - return GetSystemMetrics(nIndex) + return int32(math.Round(float64(GetSystemMetrics(nIndex)) * float64(dpi) / float64(GetDpiForWindow(0)))) } ret, _, _ := syscall.Syscall(getSystemMetricsForDpi.Addr(), 2, |