emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: display-mm-width return value off on Windows


From: Kim F. Storm
Subject: Re: display-mm-width return value off on Windows
Date: Mon, 10 Jul 2006 12:30:24 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> From: Ralf Angeli <address@hidden>
>> Cc: Lennart Borgman <address@hidden>,  Eli Zaretskii <address@hidden>,  
>> address@hidden
>> Date: Sun, 09 Jul 2006 09:41:53 +0200
>> 
>> If `GetDeviceCaps (hdc, HORSIZE)' always assumes a fixed DPI value
>> that would explain why the values are so inaccurate especially on
>> displays with a high DPI value.  In that case I think it makes sense
>> to use the DPI value when calculating the size (as my patch does) and
>> assume that the user set it to a value matching her monitor.
>> 
>> As a last resort we could provide user options (in Emacs) for setting
>> the correct size of the screen which will be used as return values for
>> `display-mm-{width,height}'.
>
> Sounds like a good plan to me.

I have had problems on X too (where the drivers provide wrong DPI
values), so the following piece of code in xdisp.c fails to DTRT:

#ifdef HAVE_WINDOW_SYSTEM
              if (FRAME_WINDOW_P (it->f)
                  && (ppi = (width_p
                             ? FRAME_X_DISPLAY_INFO (it->f)->resx
                             : FRAME_X_DISPLAY_INFO (it->f)->resy),
                      ppi > 0))
                return OK_PIXELS (ppi / pixels);
#endif


So I tried to do fix that (in a way similar to the one proposed for
display-mm-*) some time ago, but didn't complete it, as it wasn't
really clear what had to be done.

First of all, it had to be done per-display (at least X supports
multiple display),

Secondly, it was not clear to me whether this problem was specific
to X, but I guessed it was not, so changes had to be done for
all platforms (as it involved added stuff to "display-info".)

Last, but not least, it was unclear what other parts of the code
would also need changes -- e.g. display-mm-* -- which would have
to be reworked to not just use some X-macro like WidthMMOfScreen.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]