From 79474af88dedbbca145811da857450c9b44ac718 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 3 Apr 2022 20:06:07 +0900 Subject: [PATCH] Revert "internal/devicescale: bug fix: glfw.Monitor.GetContentScale might return 0" This reverts commit ca6f4fce158bc41a1ae736704e4bba17127c9b2d. Reason: The bug #2051 couldn't be reproduced and this fix was not needed --- internal/devicescale/impl_desktop.go | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/internal/devicescale/impl_desktop.go b/internal/devicescale/impl_desktop.go index 6f26fe957..8c7db22b0 100644 --- a/internal/devicescale/impl_desktop.go +++ b/internal/devicescale/impl_desktop.go @@ -35,13 +35,6 @@ func monitorAt(x, y int) *glfw.Monitor { } func impl(x, y int) float64 { - // Keep calling GetContentScale until the returned scale is 0 (#2051). - // Retry this at most 5 times to avoid an inifinite loop. - for i := 0; i < 5; i++ { - sx, _ := monitorAt(x, y).GetContentScale() - if sx != 0 { - return float64(sx) - } - } - return 1 + sx, _ := monitorAt(x, y).GetContentScale() + return float64(sx) }