From 594cd185674c382fbd2f012e685a1e8748f58025 Mon Sep 17 00:00:00 2001 From: Jakub Piecuch Date: Sun, 5 May 2019 22:54:57 +0200 Subject: [PATCH] Fix monitor width & height sanity check (#861) Fix monitor width & height sanity check --- CHANGELOG.md | 2 ++ src/platform/linux/x11/util/randr.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ace1cb69..aa2d352cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- On X11, fix sanity check which checks that a monitor's reported width and height (in millimeters) are non-zero when calculating the DPI factor. + # Version 0.19.1 (2019-04-08) - On Wayland, added a `get_wayland_display` function to `EventsLoopExt`. diff --git a/src/platform/linux/x11/util/randr.rs b/src/platform/linux/x11/util/randr.rs index 5054dbdb0..2d7e14644 100644 --- a/src/platform/linux/x11/util/randr.rs +++ b/src/platform/linux/x11/util/randr.rs @@ -23,7 +23,7 @@ pub fn calc_dpi_factor( } // See http://xpra.org/trac/ticket/728 for more information. - if width_mm == 0 || width_mm == 0 { + if width_mm == 0 || height_mm == 0 { warn!("XRandR reported that the display's 0mm in size, which is certifiably insane"); return 1.0; }