this is a semi-fix, but it still does not deal with monitors that have
different DPI. Perhaps this is something that needs to be looked at
for xfree 5.
Alex
--- Andrew C Aitchison <[EMAIL PROTECTED]> wrote:
> On Tue, 19 Aug 2003, Alex Deucher wrote:
>
> > How is DPI supposed to work if you have a virtual desktop larger
> than
> > the current mode? the current code seems to produce the wrong DPI.
>
> > xf86SetDpi() has the following code:
> >
> > if (pScrn->widthmm > 0) {
> > pScrn->xDpi =
> > (int)((double)pScrn->virtualX * MMPERINCH /
> pScrn->widthmm);
> > }
> > if (pScrn->heightmm > 0) {
> > pScrn->yDpi =
> > (int)((double)pScrn->virtualY * MMPERINCH /
> pScrn->heightmm);
> > }
> >
> > if you have, for example,
> > DisplaySize 300 230
> > and a virtual resolution of say 2048x768 and a mode of 1024x768,
> the
> > DPI would get set to 173, 84. which (I think) is wrong. it should
> be
> > 86, 84 which is what you would get when your mode matches your
> virtual
> > resolution. I'm having the same problem with Mergedfb since it
> uses a
> > virtual resolution with two viewports looking into it. I could add
> the
> > heightmm or widthmm of both heads to make the DPI "correct" for the
> > virtual size with respect to the two heads. I'm not sure how
> xinerama
> > deals with it. maybe the current behavior is right? I dunno.
>
> PanoramiXCreateConnectionBlock() in
> xc/programs/Xserver/Xext/panoramiX.c
> has:
> /*
> * OK, change some dimensions so it looks as if it were one big
> screen
> */
>
> old_width = root->pixWidth;
> old_height = root->pixHeight;
>
> root->pixWidth = PanoramiXPixWidth;
> root->pixHeight = PanoramiXPixHeight;
> width_mult = (1.0 * root->pixWidth) / old_width;
> height_mult = (1.0 * root->pixHeight) / old_height;
> root->mmWidth *= width_mult;
> root->mmHeight *= height_mult;
>
> which adjusts mmWidth and mmHeight in the manner you are proposing.
> mmWidth becomes pScrn->widthmm inside xf86SetDpi().
>
> --
> Andrew C Aitchison
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel