From 190320795f0cbc31bcc60a5ab4d4519b5310de86 Mon Sep 17 00:00:00 2001 From: JiangWu Date: Tue, 9 Aug 2022 07:17:07 +0000 Subject: [PATCH] randr: Correctly get physical size for screen with RandR 1.5 --- randr/rrmonitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/randr/rrmonitor.c b/randr/rrmonitor.c index e62bd484d..7b0bbfcd5 100644 --- a/randr/rrmonitor.c +++ b/randr/rrmonitor.c @@ -156,8 +156,8 @@ RRMonitorGetGeometry(RRMonitorPtr monitor, RRMonitorGeometryPtr geometry) /* Adjust physical sizes to account for total area */ if (active_crtcs > 1 && first.box.x2 != first.box.x1 && first.box.y2 != first.box.y1) { - geometry->mmWidth = (this.box.x2 - this.box.x1) / (first.box.x2 - first.box.x1) * first.mmWidth; - geometry->mmHeight = (this.box.y2 - this.box.y1) / (first.box.y2 - first.box.y1) * first.mmHeight; + geometry->mmWidth = ((double)(geometry->box.x2 - geometry->box.x1) / (first.box.x2 - first.box.x1)) * first.mmWidth; + geometry->mmHeight = ((double)(geometry->box.y2 - geometry->box.y1) / (first.box.y2 - first.box.y1)) * first.mmHeight; } } else { *geometry = monitor->geometry;