aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winprocarg.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-04 09:28:39 +0100
committermarha <marha@users.sourceforge.net>2011-11-04 09:28:39 +0100
commit23e2767dc3e6b8891d4b55b711c70c6bc85a6f85 (patch)
tree04c538697c3afbd401afb1bb614460b16be28844 /xorg-server/hw/xwin/winprocarg.c
parent125500b44d0253d7fd7a59905ab730151d4f66e2 (diff)
parent02f377d5e2dd18537d0807ad63675a0970b5a37d (diff)
downloadvcxsrv-23e2767dc3e6b8891d4b55b711c70c6bc85a6f85.tar.gz
vcxsrv-23e2767dc3e6b8891d4b55b711c70c6bc85a6f85.tar.bz2
vcxsrv-23e2767dc3e6b8891d4b55b711c70c6bc85a6f85.zip
Merge remote-tracking branch 'origin/released'
Conflicts: mesalib/src/mesa/drivers/dri/swrast/swrast_priv.h xorg-server/hw/xwin/InitOutput.c xorg-server/hw/xwin/ddraw.h xorg-server/hw/xwin/winclipboardwndproc.c xorg-server/hw/xwin/winglobals.c xorg-server/hw/xwin/winmonitors.c xorg-server/hw/xwin/winprocarg.c xorg-server/hw/xwin/winwin32rootlesswndproc.c xorg-server/include/scrnintstr.h xorg-server/xkb/ddxList.c xorg-server/xkb/ddxLoad.c
Diffstat (limited to 'xorg-server/hw/xwin/winprocarg.c')
-rw-r--r--xorg-server/hw/xwin/winprocarg.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c
index 306dce79f..683605ad7 100644
--- a/xorg-server/hw/xwin/winprocarg.c
+++ b/xorg-server/hw/xwin/winprocarg.c
@@ -89,12 +89,27 @@ winInitializeScreenDefaults(void)
dwWidth = GetSystemMetrics (SM_CXSCREEN);
dwHeight = GetSystemMetrics (SM_CYSCREEN);
- winDebug ("winInitializeScreenDefaults - w %d h %d\n",
- (int) dwWidth, (int) dwHeight);
+ winDebug ("winInitializeScreenDefaults - primary monitor w %d h %d\n", (int) dwWidth, (int) dwHeight);
- /* Set a default DPI, if no parameter was passed */
+ /* Set a default DPI, if no '-dpi' option was used */
if (monitorResolution == 0)
- monitorResolution = WIN_DEFAULT_DPI;
+ {
+ HDC hdc = GetDC(NULL);
+ if (hdc)
+ {
+ int dpiX = GetDeviceCaps(hdc, LOGPIXELSX);
+ int dpiY = GetDeviceCaps(hdc, LOGPIXELSY);
+
+ winErrorFVerb(2, "winInitializeDefaultScreens - native DPI x %d y %d\n", dpiX, dpiY);
+ monitorResolution = dpiY;
+ ReleaseDC(NULL, hdc);
+ }
+ else
+ {
+ winErrorFVerb(1, "winInitializeDefaultScreens - Failed to retrieve native DPI, falling back to default of %d DPI\n", WIN_DEFAULT_DPI);
+ monitorResolution = WIN_DEFAULT_DPI;
+ }
+ }
defaultScreenInfo.iMonitor = 1;
defaultScreenInfo.dwWidth = dwWidth;
@@ -310,8 +325,7 @@ ddxProcessArgument (int argc, char *argv[], int i)
struct GetMonitorInfoData data;
if (!QueryMonitor(iMonitor, &data))
{
- ErrorF ("ddxProcessArgument - screen - "
- "Querying monitors is not supported on NT4 and Win95\n");
+ ErrorF ("ddxProcessArgument - screen - Querying monitors failed\n");
} else if (data.bMonitorSpecifiedExists == TRUE)
{
winDebug("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor);
@@ -367,8 +381,7 @@ ddxProcessArgument (int argc, char *argv[], int i)
struct GetMonitorInfoData data;
if (!QueryMonitor(iMonitor, &data))
{
- ErrorF ("ddxProcessArgument - screen - "
- "Querying monitors is not supported on NT4 and Win95\n");
+ ErrorF ("ddxProcessArgument - screen - Querying monitors failed\n");
} else if (data.bMonitorSpecifiedExists == TRUE)
{
g_ScreenInfo[nScreenNum].iMonitor = iMonitor;
@@ -395,8 +408,7 @@ ddxProcessArgument (int argc, char *argv[], int i)
struct GetMonitorInfoData data;
if (!QueryMonitor(iMonitor, &data))
{
- ErrorF ("ddxProcessArgument - screen - "
- "Querying monitors is not supported on NT4 and Win95\n");
+ ErrorF ("ddxProcessArgument - screen - Querying monitors failed\n");
} else if (data.bMonitorSpecifiedExists == TRUE)
{
winDebug ("ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor);