mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
term: get_font_dpi(): don't crash when there aren't any available monitors
Seen on plasma; monitor is turned off, and then back on again. Before the "new" output global is emitted, the compositor calls fractional_scale::preferred_scale(). This results in a call to get_font_dpi(), where we crash, since it assumes there is at least one monitor available. Fix by falling back to a DPI of 96. Hopefully closes #1498
This commit is contained in:
parent
400a3f5ad2
commit
b95a7cb84f
2 changed files with 6 additions and 2 deletions
|
|
@ -826,9 +826,9 @@ get_font_dpi(const struct terminal *term)
|
|||
: &tll_front(term->wl->monitors);
|
||||
|
||||
if (term_fractional_scaling(term))
|
||||
return mon->dpi.physical;
|
||||
return mon != NULL ? mon->dpi.physical : 96.;
|
||||
else
|
||||
return mon->dpi.scaled;
|
||||
return mon != NULL ? mon->dpi.scaled : 96.;
|
||||
}
|
||||
|
||||
static enum fcft_subpixel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue