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>
This commit is contained in:
parent
df51800127
commit
a46146af5f
|
@ -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? */
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user