From 02f377d5e2dd18537d0807ad63675a0970b5a37d Mon Sep 17 00:00:00 2001 From: marha Date: Fri, 4 Nov 2011 08:57:20 +0100 Subject: xserver pixman mesa git update 4 nov 2011 --- xorg-server/hw/xwin/winprocarg.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'xorg-server/hw/xwin/winprocarg.c') diff --git a/xorg-server/hw/xwin/winprocarg.c b/xorg-server/hw/xwin/winprocarg.c index ddfe1f5b7..2b6949ed1 100644 --- a/xorg-server/hw/xwin/winprocarg.c +++ b/xorg-server/hw/xwin/winprocarg.c @@ -88,12 +88,27 @@ winInitializeScreenDefaults(void) dwWidth = GetSystemMetrics (SM_CXSCREEN); dwHeight = GetSystemMetrics (SM_CYSCREEN); - winErrorFVerb (2, "winInitializeScreenDefaults - w %d h %d\n", - (int) dwWidth, (int) dwHeight); + winErrorFVerb(2, "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; @@ -311,8 +326,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) { winErrorFVerb(2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); @@ -368,8 +382,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; @@ -396,8 +409,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) { winErrorFVerb (2, "ddxProcessArgument - screen - Found Valid ``@Monitor'' = %d arg\n", iMonitor); -- cgit v1.2.3