Fixes `-dpi` option in Xvfb

This commit is contained in:
Twaik Yont 2023-03-10 14:33:20 +02:00
parent b67dc0650a
commit 8268fe347e
3 changed files with 57 additions and 2 deletions

View File

@ -5,7 +5,7 @@ TERMUX_PKG_MAINTAINER="@termux"
# No update anymore. v1.11.x requires support of PAM.
TERMUX_PKG_VERSION=(1.10.1
21.1.7)
TERMUX_PKG_REVISION=35
TERMUX_PKG_REVISION=36
TERMUX_PKG_SRCURL=(https://github.com/TigerVNC/tigervnc/archive/v${TERMUX_PKG_VERSION}.tar.gz
https://xorg.freedesktop.org/releases/individual/xserver/xorg-server-${TERMUX_PKG_VERSION[1]}.tar.xz)
TERMUX_PKG_SHA256=(19fcc80d7d35dd58115262e53cac87d8903180261d94c2a6b0c19224f50b58c4

View File

@ -0,0 +1,55 @@
+++ ./hw/vfb/InitOutput.c
@@ -753,6 +753,7 @@
CARD32 mmWidth,
CARD32 mmHeight)
{
+ rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
// Prevent screen updates while we change things around
SetRootClip(pScreen, ROOT_CLIP_NONE);
@@ -767,7 +768,7 @@
RRScreenSizeNotify (pScreen);
RRTellChanged(pScreen);
- return TRUE;
+ return RROutputSetPhysicalSize(pScrPriv->outputs[pScreen->myNum], mmWidth, mmHeight);
}
static Bool
@@ -803,6 +804,7 @@
xRRModeInfo modeInfo;
char name[64];
#endif
+ int mmWidth, mmHeight;
if (!RRScreenInit (pScreen))
return FALSE;
@@ -817,6 +819,9 @@
#endif
pScrPriv->rrOutputValidateMode = vfbRROutputValidateMode;
pScrPriv->rrModeDestroy = NULL;
+
+ mmWidth = pScreen->width * 25.4 / monitorResolution;
+ mmHeight = pScreen->height * 25.4 / monitorResolution;
RRScreenSetSizeRange (pScreen,
1, 1,
@@ -850,6 +855,8 @@
return FALSE;
if (!RROutputSetConnection (output, RR_Connected))
return FALSE;
+ if (!RROutputSetPhysicalSize (output, mmWidth, mmHeight))
+ return FALSE;
RRCrtcNotify (crtc, mode, 0, 0, RR_Rotate_0, NULL, 1, &output);
#endif
return TRUE;
@@ -957,6 +964,9 @@
{
int i;
int NumFormats = 0;
+
+ if (!monitorResolution)
+ monitorResolution = 96;
/* initialize pixmap formats */

View File

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="X virtual framebuffer"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=21.1.7
TERMUX_PKG_REVISION=1
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/xserver/xorg-server-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=d9c60b2dd0ec52326ca6ab20db0e490b1ff4f566f59ca742d6532e92795877bb