aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
diff options
context:
space:
mode:
authorSimon Matter <simon.matter@invoca.ch>2017-10-09 11:36:23 +0200
committerMihai Moldovan <ionic@ionic.de>2018-02-27 09:29:45 +0100
commit9dd2830e0c01e163a3ba92cb07476c02fd132b99 (patch)
tree665c9c4493fc678df5a51211c417a4c04d5f6bcb /nx-X11/programs/Xserver/hw/nxagent/Extensions.c
parenta88ca271751c1bcf90b352b8c5a79631263c56aa (diff)
downloadnx-libs-9dd2830e0c01e163a3ba92cb07476c02fd132b99.tar.gz
nx-libs-9dd2830e0c01e163a3ba92cb07476c02fd132b99.tar.bz2
nx-libs-9dd2830e0c01e163a3ba92cb07476c02fd132b99.zip
nxagent: Auto-detect client-side DPI at session startup.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Extensions.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Extensions.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
index 211af8ccf..05a4b4f13 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c
@@ -338,15 +338,26 @@ static int nxagentRandRInitSizes(ScreenPtr pScreen)
width = w[i];
height = h[i];
- mmWidth = (width * 254 + monitorResolution * 5) / (monitorResolution * 10);
+ if (monitorResolution < 0)
+ {
+ mmWidth = width * DisplayWidthMM(nxagentDisplay, DefaultScreen(nxagentDisplay)) /
+ DisplayWidth(nxagentDisplay, DefaultScreen(nxagentDisplay));
+
+ mmHeight = height * DisplayHeightMM(nxagentDisplay, DefaultScreen(nxagentDisplay)) /
+ DisplayHeight(nxagentDisplay, DefaultScreen(nxagentDisplay));
+ }
+ else
+ {
+ mmWidth = (width * 254 + monitorResolution * 5) / (monitorResolution * 10);
+ mmHeight = (height * 254 + monitorResolution * 5) / (monitorResolution * 10);
+
+ }
if (mmWidth < 1)
{
mmWidth = 1;
}
- mmHeight = (height * 254 + monitorResolution * 5) / (monitorResolution * 10);
-
if (mmHeight < 1)
{
mmHeight = 1;