mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-25 10:27:24 +00:00
Be a little more stringent with Xft parsing
This commit is contained in:
parent
357a415386
commit
1d1138ca31
1 changed files with 3 additions and 2 deletions
|
|
@ -78,9 +78,10 @@ def x11_dpi_native():
|
|||
raise RuntimeError('Could not connect to the X server')
|
||||
try:
|
||||
db = XResourceManagerString(display).decode('utf-8')
|
||||
q = 'Xft.dpi:\t'
|
||||
for line in db.splitlines():
|
||||
if line.startswith('Xft.dpi:'):
|
||||
return float(line.split()[1])
|
||||
if line.startswith(q):
|
||||
return float(line[len(q):])
|
||||
finally:
|
||||
XCloseDisplay(display)
|
||||
raise RuntimeError('Failed to get dpi resource')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue