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
This commit is contained in:
Kovid Goyal
2017-01-07 14:30:25 +05:30
parent 1cdd481e00
commit 07511a5621

View File

@@ -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