aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-09-22 16:33:24 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-09-23 18:31:08 +0000
commit50ae277d90c1eea6bb0086c31e004042088f794f (patch)
tree5f983017828db85a7b410966b639439b0cf0e470
parentrender: timer: print/log *total* rendering time (diff)
wayland: don’t crash with a division-by-zero when monitor dimensions are negative
Some compositors set the physical dimensions to -1...
-rw-r--r--wayland.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wayland.c b/wayland.c
index 05de79aa..cd052532 100644
--- a/wayland.c
+++ b/wayland.c
@@ -367,7 +367,7 @@ update_terms_on_monitor(struct monitor *mon)
static void
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;
int x_inches = mon->dim.mm.width * 0.03937008;