diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2010-04-01 21:00:43 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-01-19 14:02:17 +0000 |
commit | a46146af5f6c2d96728c43f0df369ea00bcae017 (patch) | |
tree | ffdb49edf67868f93da9c46dc08c55925817740d /hw/xwin | |
parent | df518001271dbc0c49935350b755f0c0562cdb92 (diff) |
Cygwin/X: Rather than storing calculated physical display sizes, calculate them when needed
(This stored calculation was wrong if -dpi came after -screen on the command
line, anyhow)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
Diffstat (limited to 'hw/xwin')
-rw-r--r-- | hw/xwin/win.h | 2 | ||||
-rw-r--r-- | hw/xwin/winprocarg.c | 13 | ||||
-rw-r--r-- | hw/xwin/winrandr.c | 4 | ||||
-rw-r--r-- | hw/xwin/winscrinit.c | 4 |
4 files changed, 2 insertions, 21 deletions
diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 3c706c409..8b7b69990 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -395,8 +395,6 @@ typedef struct DWORD dwUserHeight; DWORD dwWidth; DWORD dwHeight; - DWORD dwWidth_mm; - DWORD dwHeight_mm; DWORD dwPaddedWidth; /* Did the user specify a screen position? */ diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c index 1ce5c2dca..c93169676 100644 --- a/hw/xwin/winprocarg.c +++ b/hw/xwin/winprocarg.c @@ -174,8 +174,6 @@ winInitializeScreenDefaults(void) defaultScreenInfo.fScrollbars = FALSE; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_OFF; - defaultScreenInfo.dwWidth_mm = (dwWidth / WIN_DEFAULT_DPI) * 25.4; - defaultScreenInfo.dwHeight_mm = (dwHeight / WIN_DEFAULT_DPI) * 25.4; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; defaultScreenInfo.fUseUnixKillKey = WIN_DEFAULT_UNIX_KILL; defaultScreenInfo.fIgnoreInput = FALSE; @@ -500,17 +498,6 @@ ddxProcessArgument (int argc, char *argv[], int i) g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE; } - /* Calculate the screen width and height in millimeters */ - if (g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth) - { - g_ScreenInfo[nScreenNum].dwWidth_mm - = (g_ScreenInfo[nScreenNum].dwWidth - / monitorResolution) * 25.4; - g_ScreenInfo[nScreenNum].dwHeight_mm - = (g_ScreenInfo[nScreenNum].dwHeight - / monitorResolution) * 25.4; - } - /* Flag that this screen was explicity specified by the user */ g_ScreenInfo[nScreenNum].fExplicitScreen = TRUE; diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 7b5b1359c..fd1d97ea4 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -86,8 +86,8 @@ winRandRGetInfo (ScreenPtr pScreen, Rotation *pRotations) pSize = RRRegisterSize (pScreen, pScreenInfo->dwWidth, pScreenInfo->dwHeight, - pScreenInfo->dwWidth_mm, - pScreenInfo->dwHeight_mm); + (pScreenInfo->dwWidth / monitorResolution) * 25.4, + (pScreenInfo->dwHeight / monitorResolution) * 25.4); /* Tell RandR what the current config is */ RRSetCurrentConfig (pScreen, diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index bf6181add..46f6693bd 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -190,10 +190,6 @@ winScreenInit (int index, { pScreenInfo->dwWidth = GetSystemMetrics (SM_CXVIRTUALSCREEN); pScreenInfo->dwHeight = GetSystemMetrics (SM_CYVIRTUALSCREEN); - pScreenInfo->dwWidth_mm = (pScreenInfo->dwWidth / - WIN_DEFAULT_DPI) * 25.4; - pScreenInfo->dwHeight_mm = (pScreenInfo->dwHeight / - WIN_DEFAULT_DPI) * 25.4; } } else |