mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
term: default to DPI 96, if the monitor's DPI is 0
This can happen in virtualized environments, or when running a nested Wayland session.
This commit is contained in:
parent
acbb3cbb70
commit
128c5c3efa
2 changed files with 13 additions and 4 deletions
|
|
@ -58,6 +58,12 @@
|
|||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
* Crash when zooming in or out, with `dpi-aware=yes`, and the
|
||||
monitor's DPI is 0 (this is true for, for example, nested Wayland
|
||||
sessions, or in virtualized environments).
|
||||
|
||||
|
||||
### Security
|
||||
### Contributors
|
||||
|
||||
|
|
|
|||
11
terminal.c
11
terminal.c
|
|
@ -878,10 +878,13 @@ get_font_dpi(const struct terminal *term)
|
|||
mon = &tll_front(term->wl->monitors);
|
||||
}
|
||||
|
||||
if (term_fractional_scaling(term))
|
||||
return mon != NULL ? mon->dpi.physical : 96.;
|
||||
else
|
||||
return mon != NULL ? mon->dpi.scaled : 96.;
|
||||
const float monitor_dpi = mon != NULL
|
||||
? term_fractional_scaling(term)
|
||||
? mon->dpi.physical
|
||||
: mon->dpi.scaled
|
||||
: 96.;
|
||||
|
||||
return monitor_dpi > 0. ? monitor_dpi : 96.;
|
||||
}
|
||||
|
||||
static enum fcft_subpixel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue