Fix DPI at startup in RandR 1.2 code.

Use requested monitor resolution to compute the appropriate screen size when
resizing the screen during RandR initialization.
This commit is contained in:
Keith Packard 2006-10-05 09:11:29 -07:00
parent 4ac81d58b7
commit 0a5504e59f
1 changed files with 16 additions and 3 deletions

View File

@ -832,12 +832,25 @@ I830RandRCreateScreenResources12 (ScreenPtr pScreen)
mode = pScrn->currentMode;
if (mode)
{
int mmWidth, mmHeight;
if (mode->HDisplay == pScreen->width &&
mode->VDisplay == pScreen->height)
{
mmWidth = pScrn->widthmm;
mmHeight = pScrn->heightmm;
}
else
{
#define MMPERINCH 25.4
mmWidth = (double) mode->HDisplay / pScrn->xDpi * MMPERINCH;
mmHeight = (double) mode->VDisplay / pScrn->yDpi * MMPERINCH;
}
I830RandRScreenSetSize (pScreen,
mode->HDisplay,
mode->VDisplay,
pScreen->mmWidth,
pScreen->mmHeight);
mmWidth,
mmHeight);
}
for (i = 0; i < MAX_DISPLAY_PIPES; i++)