From 07511a56216b6d4158e56263ba1ea94c5a5b6993 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 7 Jan 2017 14:30:25 +0530 Subject: [PATCH] Dont use xdpyinfo on OS X Need to investigate if a separate implementation is needed or if we can just trust the values from GLFW --- kitty/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kitty/utils.py b/kitty/utils.py index 4cd3a3746..420390e9c 100644 --- a/kitty/utils.py +++ b/kitty/utils.py @@ -46,9 +46,13 @@ def sanitize_title(x): def get_logical_dpi(): if not hasattr(get_logical_dpi, 'ans'): - raw = subprocess.check_output(['xdpyinfo']).decode('utf-8') - m = re.search(r'^\s*resolution:\s*(\d+)+x(\d+)', raw, flags=re.MULTILINE) - get_logical_dpi.ans = int(m.group(1)), int(m.group(2)) + if isosx: + # TODO: Investigate if this needs a different implementation on OS X + get_logical_dpi.ans = glfw_get_physical_dpi() + else: + raw = subprocess.check_output(['xdpyinfo']).decode('utf-8') + m = re.search(r'^\s*resolution:\s*(\d+)+x(\d+)', raw, flags=re.MULTILINE) + get_logical_dpi.ans = int(m.group(1)), int(m.group(2)) return get_logical_dpi.ans