From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: display-mm-width return value off on Windows Date: Mon, 10 Jul 2006 12:30:24 +0200 Message-ID: References: <87slldpd8s.fsf@neutrino.caeruleus.net> <44AFB1E1.20906@student.lu.se> <8764i7kywu.fsf@neutrino.caeruleus.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1152527585 23344 80.91.229.2 (10 Jul 2006 10:33:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2006 10:33:05 +0000 (UTC) Cc: Ralf Angeli , lennart.borgman.073@student.lu.se, jasonr@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 10 12:33:02 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fzt4M-00077d-1s for ged-emacs-devel@m.gmane.org; Mon, 10 Jul 2006 12:32:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fzt4L-0008RY-Fg for ged-emacs-devel@m.gmane.org; Mon, 10 Jul 2006 06:32:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Fzt48-0008Ql-P7 for emacs-devel@gnu.org; Mon, 10 Jul 2006 06:32:36 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Fzt44-0008QM-RF for emacs-devel@gnu.org; Mon, 10 Jul 2006 06:32:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fzt44-0008QJ-MV for emacs-devel@gnu.org; Mon, 10 Jul 2006 06:32:32 -0400 Original-Received: from [195.41.46.237] (helo=pfepc.post.tele.dk) by monty-python.gnu.org with esmtp (Exim 4.52) id 1Fzt55-0006YJ-04; Mon, 10 Jul 2006 06:33:35 -0400 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepc.post.tele.dk (Postfix) with SMTP id 906588A0014; Mon, 10 Jul 2006 12:32:13 +0200 (CEST) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Sun, 09 Jul 2006 21:37:46 +0300") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:56880 Archived-At: Eli Zaretskii writes: >> From: Ralf Angeli >> Cc: Lennart Borgman , Eli Zaretskii , 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 http://www.cua.dk