unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: Ralf Angeli <angeli@caeruleus.net>,
	lennart.borgman.073@student.lu.se, jasonr@gnu.org,
	emacs-devel@gnu.org
Subject: Re: display-mm-width return value off on Windows
Date: Mon, 10 Jul 2006 12:30:24 +0200	[thread overview]
Message-ID: <m31wstkb0f.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <uodvyoc91.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 09 Jul 2006 21:37:46 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Ralf Angeli <angeli@caeruleus.net>
>> Cc: Lennart Borgman <lennart.borgman.073@student.lu.se>,  Eli Zaretskii <eliz@gnu.org>,  emacs-devel@gnu.org
>> 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 <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2006-07-10 10:30 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-06 17:50 display-mm-width return value off on Windows Ralf Angeli
2006-07-06 21:08 ` Eli Zaretskii
2006-07-06 21:25   ` David Kastrup
2006-07-07  5:56   ` Ralf Angeli
2006-07-07 10:18     ` Eli Zaretskii
2006-07-07 10:22     ` Eli Zaretskii
2006-07-07 12:05       ` Lennart Borgman
2006-07-07 16:54       ` Ralf Angeli
2006-07-08 12:58         ` Eli Zaretskii
2006-07-08 13:23           ` Lennart Borgman
2006-07-08 14:42             ` Eli Zaretskii
2006-07-08 21:27             ` Jason Rumney
2006-07-08 22:23               ` David Kastrup
2006-07-08 23:03                 ` Jason Rumney
2006-07-09  7:36                   ` Ralf Angeli
2006-07-09  8:03                     ` David Kastrup
2006-07-09  7:41               ` Ralf Angeli
2006-07-09  8:05                 ` David Kastrup
2006-07-09 18:37                 ` Eli Zaretskii
2006-07-10 10:30                   ` Kim F. Storm [this message]
2006-07-10 10:45                     ` David Kastrup
2006-07-10 13:29                       ` Jason Rumney
2006-07-10 14:19                         ` David Kastrup
2006-07-10 21:28                           ` Jason Rumney
2006-07-10 22:05                             ` David Kastrup
2006-07-10 20:12                     ` Eli Zaretskii
2006-07-10 23:17                       ` Kim F. Storm
2006-07-10 23:22                         ` David Kastrup
2006-07-11 18:43                   ` Ralf Angeli
2006-07-12 13:07                     ` Kim F. Storm
2006-07-12 19:22                     ` Richard Stallman
2006-07-13 19:38                       ` Ralf Angeli
2006-07-13 19:59                         ` David Kastrup
2006-07-14 17:03                           ` Richard Stallman
2006-07-14 18:16                           ` Stefan Monnier
2006-07-14 18:33                             ` David Kastrup
2006-07-14 21:37                               ` Stefan Monnier
2006-07-15 22:06                                 ` Ralf Angeli
2006-07-16 17:04                                   ` Ralf Angeli
2006-07-14 17:03                         ` Richard Stallman
2006-07-09  9:31               ` Jan Djärv
2006-07-08 17:40           ` Robert J. Chassell
2006-07-06 22:09 ` Jason Rumney
2006-07-06 22:37   ` Lennart Borgman
2006-07-07  5:50   ` Ralf Angeli
2006-07-07  9:09     ` Eli Zaretskii
2006-08-05 14:50 ` Ralf Angeli
2006-08-19 15:15   ` Ralf Angeli
2006-08-19 15:37     ` David Kastrup
2006-08-19 16:31     ` Jason Rumney
2006-08-19 17:54       ` Ralf Angeli
2006-08-19 22:34         ` Jason Rumney
2006-08-20  8:19           ` Ralf Angeli
2006-08-21  9:06             ` Eli Zaretskii
2006-08-21  9:17               ` Lennart Borgman
2006-08-21 10:22                 ` Eli Zaretskii
2006-08-21 10:36                   ` David Kastrup
2006-08-21 11:45                     ` Jason Rumney
2006-08-21 11:55                       ` David Kastrup
2006-08-21 10:43                   ` Lennart Borgman
2006-08-21 14:07                     ` Eli Zaretskii
2006-08-21 15:03                       ` Lennart Borgman
2006-08-21 19:22               ` Ralf Angeli
2006-08-21 23:10                 ` Eli Zaretskii
2006-08-22  5:57                   ` Ralf Angeli
2006-08-22 19:16                     ` Ralf Angeli
2006-08-22 21:38                       ` Kim F. Storm
2006-08-23 18:31                         ` Ralf Angeli
2006-08-23 22:44                           ` Kim F. Storm
2006-08-24 16:14                             ` Ralf Angeli
2006-08-24 20:18                               ` Kim F. Storm
2006-08-25 16:38                                 ` Ralf Angeli
2006-08-25 22:28                                   ` Kim F. Storm
2006-08-21 23:25                 ` Jason Rumney
2006-08-22  5:51                   ` Ralf Angeli
2006-08-22  7:46                     ` Jason Rumney
2006-08-22 19:24                       ` Ralf Angeli
  -- strict thread matches above, loose matches on Subject: below --
2006-07-14 23:55 Robert J. Chassell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m31wstkb0f.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=angeli@caeruleus.net \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).