diff options
author | Mihai Moldovan <ionic@ionic.de> | 2018-02-27 09:33:19 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2018-02-27 09:33:19 +0100 |
commit | 6d4049640ed1de6a29b7108ebde89947877d5d27 (patch) | |
tree | 1ee4f2f134b971766d6b7eceb4e254f7f420c67f /nx-X11/programs/Xserver/hw/nxagent/Extensions.c | |
parent | a88ca271751c1bcf90b352b8c5a79631263c56aa (diff) | |
parent | 29c166dbed16cbc3112b4915f4e6938b92983999 (diff) | |
download | nx-libs-6d4049640ed1de6a29b7108ebde89947877d5d27.tar.gz nx-libs-6d4049640ed1de6a29b7108ebde89947877d5d27.tar.bz2 nx-libs-6d4049640ed1de6a29b7108ebde89947877d5d27.zip |
Merge branch 'sunweaver-pr/autodetect-dpi' into 3.6.x
Attributes GH PR #522: https://github.com/ArcticaProject/nx-libs/pull/522
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Extensions.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 17 |
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; |