Skip to content

Commit

Permalink
#56 choose a higher default DPI for higher resolutions
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Dec 7, 2022
1 parent 1ff7b52 commit ab7704c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xpra/x11/vfb_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,16 @@ def set_initial_resolution(resolutions, dpi=0):
if not (isinstance(v, int) for v in res):
raise ValueError(f"resolution values must be ints, found: {res} ({csv(type(v) for v in res)})")
w, h, hz = res
mdpi = dpi or 96
mdpi = dpi
#guess the DPI if we don't have one:
if mdpi<=0:
#use a higher DPI for higher resolutions
if w>=4096 or h>=2560:
mdpi = 144
elif w>=2560 or h>=1440:
mdpi = 120
else:
mdpi = 96
def rdpi(v):
return round(v * 25.4 / mdpi)
monitors[i] = {
Expand Down

0 comments on commit ab7704c

Please sign in to comment.