From 458f6a8ba8bd43d15bed115af6096497e0bf2cb0 Mon Sep 17 00:00:00 2001 From: Christian Gesse Date: Thu, 5 May 2022 09:12:03 +0200 Subject: [PATCH] Fix dpi calculation which caused problems with Linux and several monitors --- src/ui_scaling.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui_scaling.py b/src/ui_scaling.py index 8b156a7..71d2302 100644 --- a/src/ui_scaling.py +++ b/src/ui_scaling.py @@ -23,7 +23,8 @@ def get_scaling_factor(master): except: # ... if that fails try the first one in the list monitor = monitors[0] - dpi = monitor.width / (master.winfo_screenmmwidth() / 24.0) + + dpi = monitor.width / (monitor.width_mm / 24.0) scaling_factor = dpi / 72.0 except BaseException as e: print("WARNING: could not calculate monitor dpi:", e)