mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-05 07:15:30 -04:00
commit
4d2b8a993f
2 changed files with 14 additions and 3 deletions
|
|
@ -64,6 +64,7 @@
|
||||||
("permanently reset") instead of `2` ("reset") for DEC private
|
("permanently reset") instead of `2` ("reset") for DEC private
|
||||||
modes that are known but unsupported.
|
modes that are known but unsupported.
|
||||||
* Set `PWD` environment variable in the slave process ([#1179][1179]).
|
* Set `PWD` environment variable in the slave process ([#1179][1179]).
|
||||||
|
* DPI is now forced to 96 when found to be unreasonably high.
|
||||||
|
|
||||||
[1166]: https://codeberg.org/dnkl/foot/issues/1166
|
[1166]: https://codeberg.org/dnkl/foot/issues/1166
|
||||||
[1179]: https://codeberg.org/dnkl/foot/issues/1179
|
[1179]: https://codeberg.org/dnkl/foot/issues/1179
|
||||||
|
|
@ -94,10 +95,12 @@
|
||||||
* Background transparency being applied to the text "behind" the
|
* Background transparency being applied to the text "behind" the
|
||||||
cursor. Only applies to block cursor using inversed fg/bg
|
cursor. Only applies to block cursor using inversed fg/bg
|
||||||
colors. ([#1205][1205]).
|
colors. ([#1205][1205]).
|
||||||
|
* Crash when monitor’s physical size is "too small" ([#1209][1209]).
|
||||||
|
|
||||||
[1173]: https://codeberg.org/dnkl/foot/issues/1173
|
[1173]: https://codeberg.org/dnkl/foot/issues/1173
|
||||||
[1190]: https://codeberg.org/dnkl/foot/issues/1190
|
[1190]: https://codeberg.org/dnkl/foot/issues/1190
|
||||||
[1205]: https://codeberg.org/dnkl/foot/issues/1205
|
[1205]: https://codeberg.org/dnkl/foot/issues/1205
|
||||||
|
[1209]: https://codeberg.org/dnkl/foot/issues/1209
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
14
wayland.c
14
wayland.c
|
|
@ -370,8 +370,8 @@ output_update_ppi(struct monitor *mon)
|
||||||
if (mon->dim.mm.width <= 0 || mon->dim.mm.height <= 0)
|
if (mon->dim.mm.width <= 0 || mon->dim.mm.height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int x_inches = mon->dim.mm.width * 0.03937008;
|
double x_inches = mon->dim.mm.width * 0.03937008;
|
||||||
int y_inches = mon->dim.mm.height * 0.03937008;
|
double y_inches = mon->dim.mm.height * 0.03937008;
|
||||||
|
|
||||||
mon->ppi.real.x = mon->dim.px_real.width / x_inches;
|
mon->ppi.real.x = mon->dim.px_real.width / x_inches;
|
||||||
mon->ppi.real.y = mon->dim.px_real.height / y_inches;
|
mon->ppi.real.y = mon->dim.px_real.height / y_inches;
|
||||||
|
|
@ -407,8 +407,16 @@ output_update_ppi(struct monitor *mon)
|
||||||
mon->ppi.scaled.x = scaled_width / x_inches;
|
mon->ppi.scaled.x = scaled_width / x_inches;
|
||||||
mon->ppi.scaled.y = scaled_height / y_inches;
|
mon->ppi.scaled.y = scaled_height / y_inches;
|
||||||
|
|
||||||
float px_diag = sqrt(pow(scaled_width, 2) + pow(scaled_height, 2));
|
double px_diag = sqrt(pow(scaled_width, 2) + pow(scaled_height, 2));
|
||||||
mon->dpi = px_diag / mon->inch * mon->scale;
|
mon->dpi = px_diag / mon->inch * mon->scale;
|
||||||
|
|
||||||
|
if (mon->dpi > 1000) {
|
||||||
|
if (mon->name != NULL) {
|
||||||
|
LOG_WARN("%s: DPI=%f is unreasonable, using 96 instead",
|
||||||
|
mon->name, mon->dpi);
|
||||||
|
}
|
||||||
|
mon->dpi = 96;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue