File z_do-not-set-moronic-DPI.patch of Package xorg-x11-server
From 11685604edd2eacee708e920aca92081dbbe7fd8 Mon Sep 17 00:00:00 2001
From: v-fox <virtuousfox@gmail.com>
Date: Wed, 6 Dec 2017 19:16:41 +0500
Subject: [PATCH] Use real DPI instead of 96
https://bugs.freedesktop.org/show_bug.cgi?id=41115
---
hw/xfree86/modes/xf86RandR12.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index aac02db..955079c 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -800,6 +800,7 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen)
}
else {
xf86OutputPtr output = xf86CompatOutput(pScrn);
+ xf86CrtcPtr crtc = output->crtc;
if (output &&
output->conf_monitor &&
@@ -811,6 +812,17 @@ xf86RandR12CreateScreenResources(ScreenPtr pScreen)
mmWidth = output->conf_monitor->mon_width;
mmHeight = output->conf_monitor->mon_height;
}
+ else if (crtc && crtc->mode.HDisplay &&
+ output->mm_width && output->mm_height)
+ {
+ /*
+ * If the output has a mode and a declared size, use that
+ * to scale the screen size
+ */
+ DisplayModePtr mode = &crtc->mode;
+ mmWidth = output->mm_width * width / mode->HDisplay;
+ mmHeight = output->mm_height * height / mode->VDisplay;
+ }
else {
/*
* Otherwise, just set the screen to DEFAULT_DPI
--
2.15.1